Changes between Version 2 and Version 3 of Ticket #18390


Ignore:
Timestamp:
05/10/15 21:22:08 (4 years ago)
Author:
vdelecroix
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18390 – Description

    v2 v3  
    1 The `PolynomialRing` factory is written in a very complicated way and is slightly different to `FreeAlgebra`. In this ticket, we normalize the inputs of all factories involving variables.
    2 
    3 Some changes are noticeable
     1Various parents need to create variable names (the polynomial rings, free algebras, groups, the symbolic ring, etc). We fusion all of them.
    42
    531. the following will now raise `TypeError`
     
    86sage: A.<x,y,z> = FreeAlgebra(QQ, 'x,y,z')
    97}}}
     8  (see [https://groups.google.com/forum/#!topic/sage-devel/DRT84Yj73Nc the "polynomial ring" thread])
    109
    11102. The many versions are `normalize_names` are fused in `sage.misc.variables.normalize_names`
     
    1514   - the methods `normalize_names`, `_certify_name` of `CategoryObject`
    1615
     164. Problems with injection of reserved names
     17{{{
     18sage: a = SR.var('or')   # this should work
     19Traceback (most recent call last):
     20...
     21ValueError: The name "or" is not a valid Python identifier.
     22sage: QQ['or'].inject_variables()   # this should not
     23Defining or
     24}}}
     25 note: should take care of '_', 'True', 'False', 'None' and builtins (see [https://groups.google.com/forum/#!topic/sage-devel/5BAtCZnQj6o the "reserved name for variables" thread])
     26
    1727As a sided effect, we got some speedup in polynomial ring creation!
     28
     29See also:
     30 - [https://groups.google.com/forum/#!topic/sage-devel/Z7rXiKaMbOk "polynomial ring (bis)" thread] about the allowed form for creation of `PolynomialRing`, `FreeAlgebra`, etc