Python evangelists unite!
James_Althoff at i2.com
James_Althoff at i2.com
Thu Nov 29 19:18:15 EST 2001
Peter Milliken wrote:
>There is no real justification that works for these "features" of python -
OTOH, there *are* plenty of good *reasons* for them.
Consider "adding attributes to instances". Languages that don't support
this feature directly require some kind of a workaround since this is
something that one simply needs to do from time to time. A typical
workaround is to define, as part of a class's definition, a catch-all
property whose value is a hashtable. Clients add "instance-specific"
attributes to a given instance "on the fly" by adding name-value pairs to
the instance's hashtable. Java/Swing's JComponent (with its
putClientProperty and getClientProperty methods) is a good example of this
type of workaround.
Jim
More information about the Python-list
mailing list