class sage.categories.sets_with_partial_maps.SetsWithPartialMaps(s=None)

Bases: sage.categories.category_singleton.Category_singleton

The category whose objects are sets and whose morphisms are maps that are allowed to raise a ValueError on some inputs.

This category is equivalent to the category of pointed sets, via the equivalence sending an object X to X union {error}, a morphism f to the morphism of pointed sets that sends x to f(x) if f does not raise an error on x, or to error if it does.


sage: SetsWithPartialMaps()
Category of sets with partial maps

sage: SetsWithPartialMaps().super_categories()
[Category of objects]


sage: TestSuite(SetsWithPartialMaps()).run()
class HomCategory(category, name=None)

Bases: sage.categories.category.HomCategory

Initializes this HomCategory

  • category – the category whose Homsets are the objects of this category.
  • name – An optional name for this category.


We need to skip one test, since the hierarchy of hom categories isn’t consistent yet:

sage: C = sage.categories.category.HomCategory(Rings()); C
Category of hom sets in Category of rings
sage: TestSuite(C).run(skip=['_test_category_graph'])


sage: SetsWithPartialMaps().super_categories()
[Category of objects]

Previous topic

Sets With a Grading

Next topic

Unique factorization domains

This Page