On Fri, 17 Jun 2011 08:10:26 -0700 (PDT)
Harald Schilly <[email protected]> wrote:
> you can also create invalid variable names, i.e. the ones starting
> with a number:
>
> sage: var('2x')
> 2x
>
> sage: 2x
> ------------------------------------------------------------
> File "<ipython console>", line 1
> 2x
> ^
> SyntaxError: invalid syntax
>
> sage: globals()['2x']
> 2x
>
> sage: type(globals()['2x'])
> <type 'sage.symbolic.expression.Expression'>
Note that this behavior is not going to last. Only valid identifiers
will be allowed in variable names. We have 2 tickets on this:
#7496 symbolic variable names should be valid identifiers
#9724 Sage allows creation of variables with empty name
The second should be closed as a duplicate. :)
Cheers,
Burcin
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org