Mailing List Archive

Re: Object customization (was: Arbitrary attributes on
Greg Stein wrote:
>
> Your views on what an object model should be are not Python's views.

Ehm, could you explain to me what are Python's views?
Sorry, I don't see any worthy argument in your posts
that would make me switch from -1 to -0.

--
Vladimir MARANGOZOV | Vladimir.Marangozov@inrialpes.fr
http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252
Re: Object customization [ In reply to ]
On Sat, 15 Apr 2000, Vladimir Marangozov wrote:
> Greg Stein wrote:
> >
> > Your views on what an object model should be are not Python's views.
>
> Ehm, could you explain to me what are Python's views?
> Sorry, I don't see any worthy argument in your posts
> that would make me switch from -1 to -0.

"We're all adults here."

Python says that you can do what you want. It won't get in your way.
Badness is not defined. If somebody wants to write "a.author='Guido'" then
they can.

There are a number of objects that can have arbitrary attributes. Classes,
modules, and instances are a few (others?). Function objects are a
proposed additional one. In all cases, attaching new attributes is fine
and dandy -- no restriction.
(well, you can implement __setattr__ on a class instance)

Python's object model specifies a number of other behaviors, but nothing
really material here.

Of course, all these "views" are simply based on Guido's thoughts and the
implementation. Implementation, doc, current practice, and Guido's
discussions over the past eight years of Python's existence have also
contributed to the notion of "The Python Way". Some of that may be very
hard to write down, although I've attempted to write a bit of that above.
After five years of working with Python, I'd like to think that I've
absorbed and understand the Python Way. Can I state it? No. "We're all
adults here" is a good one for this discussion. If you think that function
attributes are bad for your programs, then don't use them. There are many
others who find them tremendously handy.

Cheers,
-g

--
Greg Stein, http://www.lyra.org/