Re: lazy evaluation of a variable

2012-06-17 Thread Jose H. Martinez
Another option would be to refactor your function so that it is a generator expression using the yield keyword. On Sun, Jun 17, 2012 at 7:40 PM, Peter Otten <__pete...@web.de> wrote: > Gelonida N wrote: > > > I'm having a module, which should lazily evaluate one of it's variables. > > Meaning th

Re: string to list

2012-06-13 Thread Jose H. Martinez
string.split(',') will give you an array. Example: 'AAA,",,",EEE,FFF,GGG '.split(',') ['AAA', '"', '', '"', 'EEE', 'FFF', 'GGG'] On Wed, Jun 13, 2012 at 10:53 PM, Chris Rebert wrote: > n Wed, Jun 13, 2012 at 7:29 PM, bruce g wrote: > > What is the best way to parse a

Re: using identifiers before they are defined

2012-06-12 Thread Jose H. Martinez
Seems like what you need is from othermodule import bb def aa(): bb() On Tue, Jun 12, 2012 at 2:51 PM, Ethan Furman wrote: > Julio Sergio wrote: > >> Jose H. Martinez gmail.com> writes: >> >> >>> You should define the function first and then c

Re: using identifiers before they are defined

2012-06-12 Thread Jose H. Martinez
You should define the function first and then call it. def something(i): return i a = something(5) If you want a reference to the function somewhere else you can do this: global alias = something print alias(i) On Tue, Jun 12, 2012 at 1:53 PM, Julio Sergio wrote: > I'm puzzled with