Re: [Python-Dev] function call syntax oddity

2008-01-04 Thread Raymond Hettinger
[Paul Moore] > 1 .__str__() > This one is a number "1" followed by > the operator "." followed by "__str__". FWIW, I would avoid the odd spacing and write this as: (1).__str__() Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail

Re: [Python-Dev] function call syntax oddity

2008-01-04 Thread Paul Moore
On 04/01/2008, Joseph Armbruster <[EMAIL PROTECTED]> wrote: > Cool I suppose, except here's an odd man out: > > >>> 1.__str__() >File "", line 1 > 1.__str__() > ^ > SyntaxError: invalid syntax It's parsed a floating point number - "1." - followed by the keyword "__str__". Th

[Python-Dev] function call syntax oddity

2008-01-04 Thread Joseph Armbruster
All, I was showing a co-worker some python today (using the trunk) when I stumbled upon this. I was not sure what to think since I have never really experimented with using spaces like this. So here tis. Be careful to notice the spaces as they are significant here. >>> 1.3.__str__() '1.3' >>>