[Python-Dev] Object customization
Greg Stein
gstein@lyra.org
Fri, 14 Apr 2000 16:14:01 -0700 (PDT)
On Sat, 15 Apr 2000, Vladimir Marangozov wrote:
> Greg Stein wrote:
> >
> > Python says that you can do what you want.
>
> 'Python' says nothing. Or are you The Voice of Python? <wink>
Well, yah. You're just discovering that?!
:-)
I meant "The Python Way" says that you can do what you want. It doesn't
speak often, but if you know how to hear it... it is a revelation :-)
> If custom object attributes are convenient for you, then I'd suggest to
Custom *function* attributes.
Functions are one of the few objects in Python that are "structural" in
their intent and use, yet have no way to record data. Modules and classes
have a way to, but not functions.
[ by "structure", I mean something that contributes to the structure,
organization, and mechanics of your program. as opposed to data, such as
lists, dicts, instances. ]
And ditto what Skip said about attaching attributes to ints and other
immutables.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/