Jason Scheirer a écrit :
(snip)
The 5%
of your time when you are doing metaprogramming or other abuses of the
object system are when you use get/setattr.
What makes you label metaprogramming and get/setattr as abuses ???
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 22 Aug 2008 20:50:17 -0700, maestro wrote:
Why are these functions there? Is it somehow more idiomatic to use than
to do obj.field ?
Heavens no!!! Using setattr and getattr is *less* idiomatic.
Is there something you can with them that you can't by obj.field
reference?
Why are these functions there? Is it somehow more idiomatic to use
than to do obj.field ?
Is there something you can with them that you can't by obj.field
reference?
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 22, 8:50 pm, maestro [EMAIL PROTECTED] wrote:
Why are these functions there? Is it somehow more idiomatic to use
than to do obj.field ?
Is there something you can with them that you can't by obj.field
reference?
You can generate them dynamically from strings. In some cases you
don't
On Aug 22, 10:17 pm, Jason Scheirer [EMAIL PROTECTED] wrote:
On Aug 22, 8:50 pm, maestro [EMAIL PROTECTED] wrote:
Why are these functions there? Is it somehow more idiomatic to use
than to do obj.field ?
Is there something you can with them that you can't by obj.field
reference?
You