was: Re: looking for MOP documentation
peter at engcorp.com
Fri Sep 19 18:11:29 CEST 2003
Michael Hudson wrote:
> Peter Hansen <peter at engcorp.com> writes:
> > Alan Kennedy wrote:
> > >
> > > Peter Hansen wrote:
> > > > Key phrase: "Metaobject protocols are interfaces to the language
> > > > that give users the ability to incrementally modify the language's
> > > > behavior and implementation...". Near as I can tell, part of the
> > > > whole character of Python is that a user *cannot* do either of
> > > > those things.
> > >
> > > Hmm, does this rephrasing hold any truth?
> > >
> > > "Metaclasses are interfaces to the python language
> > > that give users the ability to incrementally modify the language's
> > > behavior and implementation...".
> > >
> > > Isn't modifying standard behaviour the whole purpose of metaclasses?
> > But it doesn't really modify the *language's* behaviour in the way
> > implied by a simplistic reading of the above phrase. That is, the
> > "obvious" interpretation is that syntax and grammar are being affected,
> > not just the behaviour of one small slice of the language, specifically
> > how classes behave. In some languages the two things are not so
> > separate, but in Python they seem to be.
> Huh? Common Lisp's MOP doesn't change the language on that level,
No problem... I was deliberately taking a simplistic reading of the above,
in an attempt to elicit discussion that would clarify whether it was an
adequate description. Sounds like it's not.
> Of course, there's a sense in which Common Lisp just doesn't have much
> syntax, but Python's hardly overloaded with it, either. *The objects*
> or to be more precise the *types* of objects themselves are what
> determine really happens, and that's precisely the sort of thing
> metaclasses let you play with.
I guess this might get down to the question of whether Python is more about
the syntax, grammar, keywords, and such, of the language or more about the
standard types of objects which are provided with it. In my mind, it's
very much the former and very little the latter, but maybe that's just me.
Dicts and lists and integers are interesting and all, but I'm not sure
it's their behaviour which makes Python Python.
More information about the Python-list