Newbie: ( if good in self: print "Foobar" )

Alex Martelli aleax at aleax.it
Tue Apr 29 16:23:59 EDT 2003


David Broadwell wrote:

> BTW: Thank you, You do some good responces to the group. I especially
> liked the 'forgot ()' thread solution even though i'm sure you got flames
> for it. I'll have to read that 'primer' on metaclasses ... loooks usefull
> and potentially code saving.

Even though I'm on the forefront of those who say metaclasses aren't
all THAT complicated -- I suggest you FIRST get a good grasp of classes 
and instances and other related aspects of Python (e.g., dicts), THEN
move on to metaclasses.  You can grasp by far most of Python's OO without
reaching all the way to metaclasses -- THEN, when you do have that grasp,
yes, metaclasses can indeed be a useful way to refactor & reuse code.


Alex





More information about the Python-list mailing list