Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage/sets/family.py: NOTE -> WARNING, talk about factory later
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Aug 15, 2022
1 parent cdfb2db commit 5fa0915
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/sage/sets/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ def Family(indices, function=None, hidden_keys=[], hidden_function=None,
r"""
An immutable :class:`Container`, modeling a family `(f_i)_{i \in I}`.
:func:`Family` serves as a factory. Depending on its arguments, it constructs
an instance of a subclass of :class:`~sage.sets.family.AbstractFamily`.
Whenever possible, set and combinatorial operations (counting, iteration,
listing) on the family are induced from those of the ``indices``.
Like :class:`collections.abc.Mapping` subclasses such as :class:`dict`, it is an
associative container, providing methods :meth:`~sage.sets.family.AbstractFamily.keys`
and :meth:`~sage.sets.family.AbstractFamily.values`.
Expand All @@ -87,14 +82,17 @@ def Family(indices, function=None, hidden_keys=[], hidden_function=None,
:meth:`~sage.category.sets_cat.Sets.ParentMethods.cardinality` refer to the
:meth:`~sage.sets.family.AbstractFamily.values` side of a `Family`.
.. NOTE::
.. WARNING::
The current implementation often assumes that the function `f`
is injective; if it is not, `__iter__` may repeat elements, and
:meth:`cardinality` may be wrong.
Equality of families takes the indices into account; it is not just equality of sets.
:func:`Family` serves as a factory. Depending on its arguments, it constructs
an instance of a subclass of :class:`~sage.sets.family.AbstractFamily`.
INPUT:
- ``indices`` -- the indices (keys) for the family, or a :class:`dict`
Expand Down

0 comments on commit 5fa0915

Please sign in to comment.