Re: [sage-support] Re: Making the an inmutable sequence mutable.

2011-01-09 Thread José Díaz de Greñu y de Pedro
I've told you two ways to un-unmutate something. I just need either the doc file when it is talked about _is_inmutable thing or a doc when it is said that there is no way to make mutable an inmutable sequence. Thanks 2011/1/9 Volker Braun vbraun.n...@gmail.com There is no official way to

[sage-support] How to reinitialize a generator.

2011-01-09 Thread Trollkemada
Hi, I would like to know how to reinitialize/reset a generator. I mean, if I for example have: sage: generator = (n for n in range(1,1) if (is_prime(n) is_prime(n+2))) And then i run generator.next() for example twice. How can i reinitialize/rest this generator so that when i run

Re: [sage-support] How to reinitialize a generator.

2011-01-09 Thread Iwao Kimura
Hi, Trollkemada, Here is the same question (and answers): http://stackoverflow.com/questions/1271320/reseting-generator-object-in-python Hope this helps. On Sun, Jan 9, 2011 at 10:55 PM, Trollkemada trollkem...@gmail.com wrote: Hi, I would like to know how to reinitialize/reset a generator.

Re: [sage-support] How to reinitialize a generator.

2011-01-09 Thread José Díaz de Greñu y de Pedro
But that's in Phyton is it exactly the same for SAGE? 2011/1/9 Iwao Kimura i...@sci.u-toyama.ac.jp Hi, Trollkemada, Here is the same question (and answers): http://stackoverflow.com/questions/1271320/reseting-generator-object-in-python Hope this helps. On Sun, Jan 9, 2011 at 10:55 PM,

Re: [sage-support] Re: Making the an inmutable sequence mutable.

2011-01-09 Thread Volker Braun
The documentation of Sequence.set_immutable() is quite clear. Never means that there is no way: Definition: Sequence.set_immutable(self) Docstring: Make this object immutable, so it can never again be changed. EXAMPLES: sage: v = Sequence([1,2,3,4/5])

Re: [sage-support] Re: Making the an inmutable sequence mutable.

2011-01-09 Thread José Díaz de Greñu y de Pedro
I'm not talking about the .set_inmutable() but about _is_inmutable. Thanks for the answers 2011/1/9 Volker Braun vbraun.n...@gmail.com The documentation of Sequence.set_immutable() is quite clear. Never means that there is no way: Definition: Sequence.set_immutable(self) Docstring:

Re: [sage-support] Re: Making the an inmutable sequence mutable.

2011-01-09 Thread William Stein
On Sun, Jan 9, 2011 at 8:09 AM, Volker Braun vbraun.n...@gmail.com wrote: The documentation of Sequence.set_immutable() is quite clear. Never means that there is no way: Definition: Sequence.set_immutable(self) Docstring:        Make this object immutable, so it can never again be changed.

Re: [sage-support] How to reinitialize a generator.

2011-01-09 Thread Mike Hansen
2011/1/9 José Díaz de Greñu y de Pedro josedd...@gmail.com: But that's in Phyton is it exactly the same for SAGE? Yep! --Mike -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more

Re: [sage-support] Re: Making the an inmutable sequence mutable.

2011-01-09 Thread José Díaz de Greñu y de Pedro
Yes, it is just for my own work. William, do you know where, in the doc, can i find ANYTHING about _is_inmutable flag? 2011/1/9 William Stein wst...@gmail.com On Sun, Jan 9, 2011 at 8:09 AM, Volker Braun vbraun.n...@gmail.com wrote: The documentation of Sequence.set_immutable() is quite

Re: [sage-support] How to reinitialize a generator.

2011-01-09 Thread José Díaz de Greñu y de Pedro
I don't think so.. :S Traceback (click to the left of this block for traceback) ... NameError: name 'tee' is not defined 2011/1/9 Mike Hansen mhan...@gmail.com 2011/1/9 José Díaz de Greñu y de Pedro josedd...@gmail.com: But that's in Phyton is it exactly the same for SAGE? Yep! --Mike

Re: [sage-support] How to reinitialize a generator.

2011-01-09 Thread Francois Maltey
thanks, I discover : sage: import itertools sage: it = sxrange(10^7) sage: (it1, it2) = itertools.tee (it) sage: ... play with it1.next() and it2.next() ... F. -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to

[sage-support] user-defined functions

2011-01-09 Thread Zuker
I was unable to find much elaboration on how user-defined functions are implemented in sage. I tried things like user-defined functions site:sagemath.org in google, and very little turned up. In particular, I'm desiring to work with user-defined functions that reference variables whose values

[sage-support] Re: user-defined functions

2011-01-09 Thread Harald Schilly
On Sunday, January 9, 2011 8:21:28 PM UTC+1, Zuker wrote: I was unable to find much elaboration on how user-defined functions... Sage is an extension of Python, therefore I strongly recommend you to learn a litte bit of Python first! Here your example in the sage shell (but it is just plain

Re: [sage-support] Re: Making the an inmutable sequence mutable.

2011-01-09 Thread Justin C. Walker
On Jan 9, 2011, at 08:32 , José Díaz de Greñu y de Pedro wrote: Yes, it is just for my own work. William, do you know where, in the doc, can i find ANYTHING about _is_inmutable flag? AFAIK, there is no documentation, per se, on this flag. Your best bet at this point is to use, in sage, the

Re: [sage-support] Re: Making the an inmutable sequence mutable.

2011-01-09 Thread José Díaz de Greñu y de Pedro
Okey, thank you and sorry about the text in spanish. 2011/1/9 Justin C. Walker jus...@mac.com On Jan 9, 2011, at 08:32 , José Díaz de Greñu y de Pedro wrote: Yes, it is just for my own work. William, do you know where, in the doc, can i find ANYTHING about _is_inmutable flag? AFAIK,

Re: [sage-support] How to reinitialize a generator.

2011-01-09 Thread José Díaz de Greñu y de Pedro
Thanks Anything in the doc about that? 2011/1/9 Francois Maltey fmal...@nerim.fr thanks, I discover : sage: import itertools sage: it = sxrange(10^7) sage: (it1, it2) = itertools.tee (it) sage: ... play with it1.next() and it2.next() ... F. -- To post to this group, send email

Re: [sage-support] How to reinitialize a generator.

2011-01-09 Thread Mike Hansen
2011/1/9 José Díaz de Greñu y de Pedro josedd...@gmail.com: Anything in the doc about that? http://docs.python.org/library/itertools.html#itertools.tee --Mike -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to