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

Commit

Permalink
Fixed trivial failing doctests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Jul 29, 2014
1 parent f8539f4 commit 79db91e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 49 deletions.
3 changes: 1 addition & 2 deletions src/sage/categories/algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ def extra_super_categories(self):
sage: sorted(C.super_categories(), key=str)
[Category of Cartesian products of commutative additive groups,
Category of Cartesian products of distributive magmas and additive magmas,
Category of Cartesian products of semigroups,
Category of Cartesian products of unital magmas,
Category of Cartesian products of monoids,
Category of algebras over Rational Field]
"""
return [self.base_category()]
Expand Down
82 changes: 39 additions & 43 deletions src/sage/categories/cartesian_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,55 +39,51 @@ class CartesianProductFunctor(CovariantFunctorialConstruction):
monoids (hence in the category `Monoids()`), then the result is
automatically endowed with its natural monoid structure::
sage: M = Monoids().example()
sage: M
An example of a monoid: the free monoid generated by ('a', 'b', 'c', 'd')
sage: M.rename('M')
sage: C = cartesian_product([M, ZZ, QQ])
sage: C
The cartesian product of (M, Integer Ring, Rational Field)
sage: C.an_element()
('abcd', 1, 1/2)
sage: C.an_element()^2
('abcdabcd', 1, 1/4)
sage: C.category()
Join of Category of monoids
and Category of Cartesian products of semigroups
and Category of Cartesian products of unital magmas
sage: Monoids().CartesianProducts()
Join of Category of monoids
and Category of Cartesian products of semigroups
and Category of Cartesian products of unital magmas
sage: M = Monoids().example()
sage: M
An example of a monoid: the free monoid generated by ('a', 'b', 'c', 'd')
sage: M.rename('M')
sage: C = cartesian_product([M, ZZ, QQ])
sage: C
The cartesian product of (M, Integer Ring, Rational Field)
sage: C.an_element()
('abcd', 1, 1/2)
sage: C.an_element()^2
('abcdabcd', 1, 1/4)
sage: C.category()
Category of Cartesian products of monoids
sage: Monoids().CartesianProducts()
Category of Cartesian products of monoids
The Cartesian product functor is covariant: if ``A`` is a
subcategory of ``B``, then ``A.CartesianProducts()`` is a
subcategory of ``B.CartesianProducts()`` (see also
:class:`~sage.categories.covariant_functorial_construction.CovariantFunctorialConstruction`)::
sage: C.categories()
[Join of ...,
Category of monoids,
Category of Cartesian products of semigroups,
Category of semigroups,
Category of Cartesian products of unital magmas,
Category of Cartesian products of magmas,
Category of unital magmas,
Category of magmas,
Category of Cartesian products of sets,
Category of sets, ...]
[Category of Cartesian products of monoids,
Category of monoids,
Category of Cartesian products of semigroups,
Category of semigroups,
Category of Cartesian products of magmas,
Category of unital magmas,
Category of magmas,
Category of Cartesian products of sets,
Category of sets,
Category of sets with partial maps,
Category of objects]
sage: C.categories()
[Category of Cartesian products of monoids,
Category of monoids,
Category of Cartesian products of semigroups,
Category of semigroups,
Category of Cartesian products of unital magmas,
Category of Cartesian products of magmas,
Category of unital magmas,
Category of magmas,
Category of Cartesian products of sets,
Category of sets, ...]
[Category of Cartesian products of monoids,
Category of monoids,
Category of Cartesian products of semigroups,
Category of semigroups,
Category of Cartesian products of magmas,
Category of unital magmas,
Category of magmas,
Category of Cartesian products of sets,
Category of sets,
Category of sets with partial maps,
Category of objects]
Hence, the role of ``Monoids().CartesianProducts()`` is solely to
provide mathematical information and algorithms which are relevant
Expand Down
6 changes: 2 additions & 4 deletions src/sage/categories/covariant_functorial_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,11 @@ def category_from_categories(self, categories):
sage: Cat2 = Groups()
sage: cartesian_product.category_from_categories((Cat1, Cat1, Cat1))
Join of Category of rings and ...
and Category of Cartesian products of semigroups and ...
and Category of Cartesian products of monoids
and Category of Cartesian products of commutative additive groups
sage: cartesian_product.category_from_categories((Cat1, Cat2))
Join of Category of monoids
and Category of Cartesian products of semigroups
and Category of Cartesian products of unital magmas
Category of Cartesian products of monoids
"""
assert(len(categories) > 0)
return self.category_from_category(Category.meet(categories))
Expand Down

0 comments on commit 79db91e

Please sign in to comment.