Odd syntactic NON-error?
haag at lsu.edu
Fri Jan 30 21:42:28 CET 2009
<20090130173948.12853.732928641.divmod.quotient.543 at henry.divmod.com>,
Jean-Paul Calderone <exarkun at divmod.com> wrote:
> On Fri, 30 Jan 2009 11:36:45 -0600, Alaric Haag <haag at lsu.edu> wrote:
> >I just noticed that I've been successfully importing a module I wrote
> >which contains a class definition that begins with (docstring removed):
> >class TDF():
> > def __init__(self, name='', mode=tscan. GP_NOCLOBBER):
> >Note the "space" which shouldn't be here---^
> The space is irrelevant.
> >>> object. __init__
> <slot wrapper '__init__' of 'object' objects>
> >>> object.__init__ is object. __init__
It strikes me as strange that Python (which I love btw) would be so
loose in its syntax when "spaces matter" at the beginning of a line.
I now see that a space could precede the period too, as in:
x = foo . method()
So, is the "secret" that the period is syntactically an "operator" like
+ or * ?
More information about the Python-list