Spaces in object attribute
Cesar Douady
cesar.douady at asim.lip6.fr
Thu Jan 10 10:49:07 EST 2002
In article <a1kaig$ra2ih$1 at ID-11957.news.dfncis.de>, "Emile van Sebille"
<emile at fenx.com> wrote:
>>>> obj . attr # look! the period binds!
> 1
>>>> obj . attr
> 1
>
> Do people really write programs that use this? I'm not looking to
> change it, just understand why I got bit by it. ;-)
Would you find it crasy to write :
someVariable .myAttr = ...
someLongerVariable.myAttr = ...
(sorry if it does not appear aligned, I used a fixed font when writing
code)
I often do that when the 2 assignments are semantically related.
>
> I did find http://www.python.org/doc/current/ref/delimiters.html and
> thinking of a period as a delimiter completes my understanding of this.
> I don't know why I previously assumed differently. ;-)
>
> Thanks to you and Martin for setting me straight.
>
> --
>
> Emile van Sebille
> emile at fenx.com
>
> ---------
>
More information about the Python-list
mailing list