G
Gerrit Holl
Hi,
PEP 289 says:
(Loop variables may also use constructs like x or x.a; this form may be deprecated.)
What is this about? I found this:
19:41:33:232:35 >>> a=Test()
19:41:37:232:36 >>> for a.foo in L: print a.foo
19:41:37:232:36 ...
<__main__.Test object at 0x4018516c>
<__main__.Test object at 0x401854cc>
<__main__.Test object at 0x401854ac>
19:41:49:232:37 >>> for obj in L: print obj.foo,
19:41:49:232:37 ...
bar baz bax
What is the use of this? When should I use it? Why 'may it be deprecated'?
I don't see this construct in the Language Reference. I looked at:
http://www.python.org/dev/doc/devel/ref/for.html
yours probably,
Gerrit.
PEP 289 says:
(Loop variables may also use constructs like x or x.a; this form may be deprecated.)
What is this about? I found this:
19:41:33:232:35 >>> a=Test()
19:41:37:232:36 >>> for a.foo in L: print a.foo
19:41:37:232:36 ...
<__main__.Test object at 0x4018516c>
<__main__.Test object at 0x401854cc>
<__main__.Test object at 0x401854ac>
19:41:49:232:37 >>> for obj in L: print obj.foo,
19:41:49:232:37 ...
bar baz bax
What is the use of this? When should I use it? Why 'may it be deprecated'?
I don't see this construct in the Language Reference. I looked at:
http://www.python.org/dev/doc/devel/ref/for.html
yours probably,
Gerrit.