On 02/17/2010 10:23 PM, Dana Ernst wrote:
* one should also avoid using "i" and "I" as variables for the same
obvious reason as for "e"
I've also run into problems when using "n" or "N" as a variable, since
that is the numeric approximation function (that is used later in the
tutorial).
Yes, very good point. I add that, too.
* just a comment: I never used del(); in fact, I didn't know it existed
before reading your intro (thanks!); I normally just define f to be
the next thing I'm interested in. Actually, I don't know how to get
information about del() in Sage; trying del? is not successful.
That's because del is not a function, but is a keyword in Python:
http://docs.python.org/reference/simple_stmts.html#the-del-statement
I think the pythonic way of using it is without the parentheses, as
shown in the manual above. Dana, I'd suggest you change the example to
not use parentheses.
Note that this is how you delete things in dictionaries or lists too
sage: mylist=['a','b','c']
sage: del mylist[1]
sage: mylist
['a', 'c']
sage: mylist=range(10)
sage: mylist
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sage: del mylist[2:5]
sage: mylist
[0, 1, 5, 6, 7, 8, 9]
sage:
sage: mydict={'a':'something', 'b': 'something else'}
sage: del mydict['b']
sage: mydict
{'a': 'something'}
We should probably make matrices, for example, work with the del statement:
sage: del m[1,1]
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
/home/jason/.sage/temp/littleone/2581/_home_jason__sage_init_sage_0.py
in <module>()
NotImplementedError: Subscript deletion not supported by
sage.matrix.matrix_integer_dense.Matrix_integer_dense
Thanks,
Jason
--
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