A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-January/075881.html below:

[Python-Dev] function call syntax oddity

[Python-Dev] function call syntax oddity [Python-Dev] function call syntax oddityJoseph Armbruster josepharmbruster at gmail.com
Fri Jan 4 22:25:57 CET 2008
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'

>>> 1.3    .__str__()
'1.3'

>>> a = " somestring       "

>>> a          .split()
['somestring']

>>> a.         split()
['somestring']


Cool I suppose, except here's an odd man out:

>>> 1.__str__()
  File "<stdin>", line 1
    1.__str__()
            ^
SyntaxError: invalid syntax

>>> 1 .__str__()
'1'

Joseph Armbruster
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20080104/b40ae1b2/attachment.htm 
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4