[Tutor] Calling a number's methods

Mark Young marky1991 at gmail.com
Wed Jun 23 09:41:58 CEST 2010


Hmm, apparently python doesn't care about whitespace in method calls or
attribute access:

class person:
    def __init__(self):
        self.name ="jim"
    def hi(self):
        print("hello")

>>> guy = person()
>>> guy    .   name
'jim'
>>> guy   .    hi()
hello

That at least explains that part of my question. I never knew this, although
it's pretty ugly, so I guess it's fairly useless information. Thanks for the
guess, Alan. That seems reasonable.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100623/536849e6/attachment.html>


More information about the Tutor mailing list