Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify definition of unique parent condition #39057

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sage/categories/homset.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def Hom(X, Y, category=None, check=True):
"""
# This should use cache_function instead
# However some special handling is currently needed for
# domains/docomains that break the unique parent condition. Also,
# domains/codomains that break the unique parent condition. Also,
# at some point, it somehow broke the coercion (see e.g. sage -t
# sage.rings.real_mpfr). To be investigated.
global _cache
Expand Down
3 changes: 1 addition & 2 deletions src/sage/structure/coerce_dict.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ two parents (:issue:`715`) and to store homsets of pairs of objects of a
category (:issue:`11521`). In both cases, it is essential that the parent
structures remain garbage collectable, it is essential that the data access is
faster than with a usual :class:`~weakref.WeakKeyDictionary`, and we enforce
the "unique parent condition" in Sage (parent structures should be identical
if they are equal).
the "unique parent condition" in Sage.

:class:`MonoDict` behaves similarly, but it takes a single item as a key. It
is used for caching the parents which allow a coercion map into a fixed other
Expand Down
2 changes: 1 addition & 1 deletion src/sage/structure/factory.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def generic_factory_unpickle(factory, *args):
(somewhere in the library of an old Sage version) a unique factory; in our
example below, it returns polynomial rings. Now suppose that we want to
replace the factory by something else, say, a class that provides the
unique parent behaviour using
unique representation behaviour using
:class:`~sage.structure.unique_representation.UniqueRepresentation`. We
show here how to make it possible to unpickle a pickle created with the
factory, automatically turning it into an instance of the new class.
Expand Down
3 changes: 3 additions & 0 deletions src/sage/structure/unique_representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,9 @@ class that inherits from :class:`UniqueRepresentation`: By adding
simultaneously inherit from :class:`CachedRepresentation` and from
:class:`~sage.misc.fast_methods.WithEqualityById`.

If the class is also a :class:`~sage.structure.parent.Parent`,
then we says it satisfies the *unique parent* condition.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"says": typo


For example, a symmetric function algebra is uniquely determined by the base
ring. Thus, it is reasonable to use :class:`UniqueRepresentation` in this
case::
Expand Down
Loading