Infinite Enumerated Sets

AUTHORS:

  • Florent Hivert (2009-11): initial revision.

class sage.categories.infinite_enumerated_sets.InfiniteEnumeratedSets(base_category)[source]

Bases: CategoryWithAxiom_singleton

The category of infinite enumerated sets.

An infinite enumerated sets is a countable set together with a canonical enumeration of its elements.

EXAMPLES:

sage: InfiniteEnumeratedSets()
Category of infinite enumerated sets
sage: InfiniteEnumeratedSets().super_categories()
[Category of enumerated sets, Category of infinite sets]
sage: InfiniteEnumeratedSets().all_super_categories()
[Category of infinite enumerated sets,
 Category of enumerated sets,
 Category of infinite sets,
 Category of sets,
 Category of sets with partial maps,
 Category of objects]
>>> from sage.all import *
>>> InfiniteEnumeratedSets()
Category of infinite enumerated sets
>>> InfiniteEnumeratedSets().super_categories()
[Category of enumerated sets, Category of infinite sets]
>>> InfiniteEnumeratedSets().all_super_categories()
[Category of infinite enumerated sets,
 Category of enumerated sets,
 Category of infinite sets,
 Category of sets,
 Category of sets with partial maps,
 Category of objects]
InfiniteEnumeratedSets()
InfiniteEnumeratedSets().super_categories()
InfiniteEnumeratedSets().all_super_categories()
class ParentMethods[source]

Bases: object

list()[source]

Raise an error because self is an infinite enumerated set.

EXAMPLES:

sage: NN = InfiniteEnumeratedSets().example()
sage: NN.list()
Traceback (most recent call last):
...
NotImplementedError: cannot list an infinite set
>>> from sage.all import *
>>> NN = InfiniteEnumeratedSets().example()
>>> NN.list()
Traceback (most recent call last):
...
NotImplementedError: cannot list an infinite set
NN = InfiniteEnumeratedSets().example()
NN.list()
random_element()[source]

Raise an error because self is an infinite enumerated set.

EXAMPLES:

sage: NN = InfiniteEnumeratedSets().example()
sage: NN.random_element()
Traceback (most recent call last):
...
NotImplementedError: infinite set
>>> from sage.all import *
>>> NN = InfiniteEnumeratedSets().example()
>>> NN.random_element()
Traceback (most recent call last):
...
NotImplementedError: infinite set
NN = InfiniteEnumeratedSets().example()
NN.random_element()

TODO: should this be an optional abstract_method instead?

tuple()[source]

Raise an error because self is an infinite enumerated set.

EXAMPLES:

sage: NN = InfiniteEnumeratedSets().example()
sage: NN.tuple()
Traceback (most recent call last):
...
NotImplementedError: cannot list an infinite set
>>> from sage.all import *
>>> NN = InfiniteEnumeratedSets().example()
>>> NN.tuple()
Traceback (most recent call last):
...
NotImplementedError: cannot list an infinite set
NN = InfiniteEnumeratedSets().example()
NN.tuple()