Python equivalent to PHP's SPL __autoload() ??

2008-04-27 Thread Ixiaus
I was curious (and have spent an enormous amount of time on Google trying to answer it for myself) if Python has anything remotely similar to PHP's SPL __autoload() for loading classes on the fly?? After digging through docs I feel doubtful there is such a language feature, but, it is possible I m

Noob: Loops and the 'else' construct

2007-10-18 Thread Ixiaus
I have just come across a site that discusses Python's 'for' and 'while' loops as having an (optional) 'else' structure. At first glance I interpreted it as being a bit like the 'default' structure in PHP's switch block... But the switch block isn't a loop, so, I am now confused as to the reason f

Noob: Loops and the 'else' construct

2007-10-18 Thread Ixiaus
I have just come across a site that discusses Python's 'for' and 'while' loops as having an (optional) 'else' structure. At first glance I interpreted it as being a bit like the 'default' structure in PHP's switch block... But the switch block isn't a loop, so, I am now confused as to the reason f

Re: Noob questions about Python

2007-10-18 Thread Ixiaus
That was a very helpful answer Steven, thank you for taking the time to write it! -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob questions about Python

2007-10-17 Thread Ixiaus
> Right idea: now to remove all those intermediate lists you construct. > 1. reversed(val) creates an iterator that runs over the elements (here > of a string) in reverse order. > 2. enumerate() is usually better than using an explicit list index. > 3. You can use a generator in your sum to avoid c

Re: Noob questions about Python

2007-10-17 Thread Ixiaus
Thank you for the quick responses. I did not know that about integer literals beginning with a '0', so thank you for the explanation. I never really use PHP except for handling basic forms and silly web stuff, this is why I picked up Python because I want to teach myself a more powerful and broad

Noob questions about Python

2007-10-17 Thread Ixiaus
I have recently (today) just started learning/playing with Python. So far I am excited and impressed (coming from PHP background). I have a few questions regarding Python behavior... val = 'string' li = list(val) print li.reverse() returns nothing, but, val = 'string' li = list(val) li.reverse(

Noob questions about Python

2007-10-17 Thread Ixiaus
I have recently (today) just started learning/playing with Python. So far I am excited and impressed (coming from PHP background). I have a few questions regarding Python behavior... val = 'string' li = list(val) print li.reverse() returns nothing, but, val = 'string' li = list(val) li.reverse(