Re: setattr() oddness

2010-01-20 Thread M.-A. Lemburg
Dieter Maurer wrote: Steven D'Aprano ste...@remove.this.cybersource.com.au writes on 18 Jan 2010 06:47:59 GMT: On Mon, 18 Jan 2010 07:25:58 +0100, Dieter Maurer wrote: Lie Ryan lie.1...@gmail.com writes on Sat, 16 Jan 2010 19:37:29 +1100: On 01/16/10 10:10, Sean DiZazzo wrote: Interesting.

Re: setattr() oddness

2010-01-19 Thread Dieter Maurer
Steven D'Aprano ste...@remove.this.cybersource.com.au writes on 18 Jan 2010 06:47:59 GMT: On Mon, 18 Jan 2010 07:25:58 +0100, Dieter Maurer wrote: Lie Ryan lie.1...@gmail.com writes on Sat, 16 Jan 2010 19:37:29 +1100: On 01/16/10 10:10, Sean DiZazzo wrote: Interesting. I can understand

Re: setattr() oddness

2010-01-17 Thread Dieter Maurer
Lie Ryan lie.1...@gmail.com writes on Sat, 16 Jan 2010 19:37:29 +1100: On 01/16/10 10:10, Sean DiZazzo wrote: Interesting. I can understand the would take time argument, but I don't see any legitimate use case for an attribute only accessible via getattr(). Well, at least not a pythonic

Re: setattr() oddness

2010-01-17 Thread Steven D'Aprano
On Mon, 18 Jan 2010 07:25:58 +0100, Dieter Maurer wrote: Lie Ryan lie.1...@gmail.com writes on Sat, 16 Jan 2010 19:37:29 +1100: On 01/16/10 10:10, Sean DiZazzo wrote: Interesting. I can understand the would take time argument, but I don't see any legitimate use case for an attribute only

Re: setattr() oddness

2010-01-16 Thread Lie Ryan
On 01/16/10 10:10, Sean DiZazzo wrote: Interesting. I can understand the would take time argument, but I don't see any legitimate use case for an attribute only accessible via getattr(). Well, at least not a pythonic use case. mostly for people (ab)using attributes instead of dictionary. --

setattr() oddness

2010-01-15 Thread Sean DiZazzo
Should the following be legal? class TEST(object): pass ... t = TEST() setattr(t, , 123) getattr(t, ) '123' ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: setattr() oddness

2010-01-15 Thread Terry Reedy
On 1/15/2010 3:37 PM, Sean DiZazzo wrote: Should the following be legal? class TEST(object): pass ... t = TEST() setattr(t, , 123) getattr(t, ) '123' Different people have different opinions as to whether setattr (and correspondingly getattr) should be strict or permissive as to whether

Re: setattr() oddness

2010-01-15 Thread Steve Holden
Terry Reedy wrote: On 1/15/2010 3:37 PM, Sean DiZazzo wrote: Should the following be legal? class TEST(object): pass ... t = TEST() setattr(t, , 123) getattr(t, ) '123' Different people have different opinions as to whether setattr (and correspondingly getattr) should be strict or

Re: setattr() oddness

2010-01-15 Thread Sean DiZazzo
On Jan 15, 2:22 pm, Terry Reedy tjre...@udel.edu wrote: On 1/15/2010 3:37 PM, Sean DiZazzo wrote: Should the following be legal? class TEST(object): pass ... t = TEST() setattr(t, , 123) getattr(t, ) '123' Different people have different opinions as to whether setattr (and

Re: setattr() oddness

2010-01-15 Thread Terry Reedy
On 1/15/2010 6:10 PM, Sean DiZazzo wrote: On Jan 15, 2:22 pm, Terry Reedytjre...@udel.edu wrote: On 1/15/2010 3:37 PM, Sean DiZazzo wrote: Should the following be legal? class TEST(object): pass ... t = TEST() setattr(t, , 123) getattr(t, ) '123' Different people have different