Opened 4 years ago
Last modified 2 years ago
#18390 new enhancement
cleanup variable factories
Reported by: | vdelecroix | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.7 |
Component: | algebra | Keywords: | |
Cc: | mforets | Merged in: | |
Authors: | Vincent Delecroix | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Various parents need to create variable names (the polynomial rings, free algebras, groups, the symbolic ring, etc). We fusion all of them.
- the following will now raise
TypeError
sage: R.<a,b> = PolynomialRing(QQ, ('a', 'b')) sage: A.<x,y,z> = FreeAlgebra(QQ, 'x,y,z')
(see the "polynomial ring" thread)
- The many versions are
normalize_names
are fused insage.misc.variables.normalize_names
- Deprecations:
- the
var_array
argument inPolynomialRing
- the methods
normalize_names
,_certify_name
ofCategoryObject
- the
- Problems with injection of reserved names
sage: a = SR.var('or') # this should work Traceback (most recent call last): ... ValueError: The name "or" is not a valid Python identifier. sage: QQ['or'].inject_variables() # this should not Defining or
note: should take care of '_', 'True', 'False', 'None' and builtins (see the "reserved name for variables" thread)
As a sided effect, we got some speedup in polynomial ring creation!
See also:
- "polynomial ring (bis)" thread about the allowed form for creation of
PolynomialRing
,FreeAlgebra
, etc
Change History (4)
comment:1 Changed 4 years ago by
- Description modified (diff)
- Summary changed from cleanup polynomial ring factory to cleanup variable factories
comment:2 Changed 4 years ago by
- Description modified (diff)
comment:3 Changed 4 years ago by
- Description modified (diff)
comment:4 Changed 2 years ago by
- Cc mforets added
Note: See
TracTickets for help on using
tickets.