Are decorators really that different from metaclasses...

Anthony Baxter anthonybaxter at gmail.com
Thu Aug 26 10:57:36 EDT 2004


On Thu, 26 Aug 2004 09:50:43 -0400, Paul Morrow <pm_mon at yahoo.com> wrote:
> Ok.  Then let's jettison the baggage with the word metadata and just
> call them 'magic attributes'.  It doesn't matter.  The essential point
> about them is that they almost /never have 'local variable' semantics/.
> They are attributes of the object being defined.  That's the point I'm
> trying to drive home here.  When we define __xxx__ attributes, we are
> not intending to create local variables.  No.  We are making declarations.

Explain to me how __getitem__ is a declaration while getMonkey is not,
assuming both are methods.

The only magic attribute that fits your case of "magic attribute" is
__metaclass__.
The overwhelming number of double-under names are not magic
attributes, or metadata, or whatever you want to call them.



More information about the Python-list mailing list