Skip to content

Commit 4f968a8

Browse files
author
Matthias Koeppe
committed
src/sage/structure/unique_representation.py: Add # optional
1 parent c5ae906 commit 4f968a8

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/sage/structure/unique_representation.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,10 @@ class is directly created, then the cache is not used::
424424
Using :class:`CachedRepresentation` has the advantage that one has a class and
425425
creates cached instances of this class by the usual Python syntax::
426426
427-
sage: G = SymmetricGroup(6)
428-
sage: issubclass(SymmetricGroup, sage.structure.unique_representation.CachedRepresentation)
427+
sage: G = SymmetricGroup(6) # optional - sage.groups
428+
sage: issubclass(SymmetricGroup, sage.structure.unique_representation.CachedRepresentation) # optional - sage.groups
429429
True
430-
sage: isinstance(G, SymmetricGroup)
430+
sage: isinstance(G, SymmetricGroup) # optional - sage.groups
431431
True
432432
433433
In contrast, a factory is just a callable object that returns something that
@@ -502,9 +502,9 @@ class :class:`~sage.misc.fast_methods.WithEqualityById`, which provides
502502
sage: G3 = G.subgroup([G((1,2,3,4,5,6)), G((1,2))]) # optional - sage.groups
503503
sage: G is G3 # optional - sage.groups
504504
False
505-
sage: type(G) == type(G3)
505+
sage: type(G) == type(G3) # optional - sage.groups
506506
False
507-
sage: G == G3
507+
sage: G == G3 # optional - sage.groups
508508
True
509509
510510
The unique representation behaviour can conveniently be implemented with a
@@ -517,9 +517,9 @@ class that inherits from :class:`UniqueRepresentation`: By adding
517517
ring. Thus, it is reasonable to use :class:`UniqueRepresentation` in this
518518
case::
519519
520-
sage: isinstance(SymmetricFunctions(CC), SymmetricFunctions)
520+
sage: isinstance(SymmetricFunctions(CC), SymmetricFunctions) # optional - sage.combinat
521521
True
522-
sage: issubclass(SymmetricFunctions, UniqueRepresentation)
522+
sage: issubclass(SymmetricFunctions, UniqueRepresentation) # optional - sage.combinat
523523
True
524524
525525
:class:`UniqueRepresentation` differs from :class:`CachedRepresentation` only
@@ -1188,15 +1188,15 @@ class UniqueRepresentation(CachedRepresentation, WithEqualityById):
11881188
the same memory representation), if and only if they were created using
11891189
equal arguments. For example, calling twice::
11901190
1191-
sage: f = SymmetricFunctions(QQ) # optional - sage.combinat
1192-
sage: g = SymmetricFunctions(QQ) # optional - sage.combinat
1191+
sage: f = SymmetricFunctions(QQ) # optional - sage.combinat sage.modules
1192+
sage: g = SymmetricFunctions(QQ) # optional - sage.combinat sage.modules
11931193
11941194
to create the symmetric function algebra over `\QQ` actually gives back the
11951195
same object::
11961196
1197-
sage: f == g # optional - sage.combinat
1197+
sage: f == g # optional - sage.combinat sage.modules
11981198
True
1199-
sage: f is g # optional - sage.combinat
1199+
sage: f is g # optional - sage.combinat sage.modules
12001200
True
12011201
12021202
This is a standard design pattern. It allows for sharing cached data (say
@@ -1211,9 +1211,9 @@ class UniqueRepresentation(CachedRepresentation, WithEqualityById):
12111211
derive from it, or make sure some of its super classes does. Also, it
12121212
groups together the class and the factory in a single gadget::
12131213
1214-
sage: isinstance(SymmetricFunctions(CC), SymmetricFunctions) # optional - sage.combinat
1214+
sage: isinstance(SymmetricFunctions(CC), SymmetricFunctions) # optional - sage.combinat sage.modules
12151215
True
1216-
sage: issubclass(SymmetricFunctions, UniqueRepresentation) # optional - sage.combinat
1216+
sage: issubclass(SymmetricFunctions, UniqueRepresentation) # optional - sage.combinat sage.modules
12171217
True
12181218
12191219
This nice behaviour is not available when one just uses a factory::
@@ -1223,7 +1223,7 @@ class UniqueRepresentation(CachedRepresentation, WithEqualityById):
12231223
...
12241224
TypeError: isinstance() arg 2 must be a type...
12251225
1226-
sage: isinstance(GF, sage.structure.factory.UniqueFactory)
1226+
sage: isinstance(GF, sage.structure.factory.UniqueFactory) # optional - sage.rings.finite_rings
12271227
True
12281228
12291229
In addition, :class:`~sage.structure.factory.UniqueFactory` only provides

0 commit comments

Comments
 (0)