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

Commit

Permalink
write doctests for coercions, common_parent, pushout
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Sep 20, 2015
1 parent 8696a6e commit 30f7058
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/sage/symbolic/subring.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
r"""
Subrings of the Symbolic Ring
TESTS:
In the following we have a couple of tests to see whether the coercion
framework works properly::
sage: from sage.symbolic.subring import SymbolicSubring
sage: V = var('a, r, x')
sage: A = SymbolicSubring(accepting_variables=(a,)); A
Symbolic Subring accepting the variable a
sage: R = SymbolicSubring(rejecting_variables=(r,)); R
Symbolic Subring rejecting the variable r
sage: C = SymbolicSubring(only_constants=True); C
Symbolic Constants Subring
::
sage: sage.categories.pushout.pushout(A, R)
Symbolic Subring rejecting the variable r
sage: sage.categories.pushout.pushout(R, C)
Symbolic Subring rejecting the variable r
sage: sage.categories.pushout.pushout(C, A)
Symbolic Subring accepting the variable a
sage: sage.categories.pushout.pushout(A, SR)
Symbolic Ring
sage: sage.categories.pushout.pushout(R, SR)
Symbolic Ring
sage: sage.categories.pushout.pushout(C, SR)
Symbolic Ring
::
sage: cm = sage.structure.element.get_coercion_model()
sage: cm.common_parent(A, R)
Symbolic Subring rejecting the variable r
sage: cm.common_parent(R, C)
Symbolic Subring rejecting the variable r
sage: cm.common_parent(C, A)
Symbolic Subring accepting the variable a
sage: cm.common_parent(A, SR)
Symbolic Ring
sage: cm.common_parent(R, SR)
Symbolic Ring
sage: cm.common_parent(C, SR)
Symbolic Ring
AUTHORS:
- Daniel Krenn (2015)
Expand Down

0 comments on commit 30f7058

Please sign in to comment.