splitting tables

robsom no.mail at no.mail.it
Wed Feb 11 19:56:22 EST 2004


> On Wed, 11 Feb 2004 00:44:18 +0000 (UTC), robsom wrote:
>> I'm beginning to appreciate Python even though at first I hated this
>> indentation thing
> 
> Yup.  Just because something seems limiting doesn't mean it is.

Right, I'm just saying that I was used to indent when I wanted and what I
wanted and that I missed the "closing instruction"
But, to be fair, I've adapted much faster than I thought. Just a matter of
getting used to it. 

> The "for index in range( size )" is mostly recommended as a way to loop
> over a list; range( size ) will elegantly generate a sequence of indices
> into a list of size "size".
> 
> What is it you don't like?

well, I just think that a kind of sintax like: for i=x to y
is much more intuitive and easy to use. It caused me a lot of errors,
particularly in the beginning because I wasn't getting the values I
wanted for the index. Again is probably just a matter of getting used to
it.

> Because somewhere earlier in that code you must have imported the name
> 'split' into the base namespace.  It's not there to begin with (and
> importing it is needlessly polluting the base namespace).
> They're two different functions.  One is a method of string objects, one
> is a function you've imported from somewhere.  (This confusion is partly
> why importing symbols into the base namespace is a bad idea.)

in fact there is an import string * instruction at the beginning.
ok, so you suggest using the method because it results in a faster code?
thanks

R




More information about the Python-list mailing list