metaclass and customization with parameters

Anna Martelli Ravenscroft anna at aleax.it
Mon Oct 4 09:56:52 EDT 2004


Carlos Ribeiro wrote:
> On 4 Oct 2004 03:23:32 -0700, Michele Simionato
> <michele.simionato at gmail.com> wrote:
> 
>>Notice that there already valuable resources on this stuff.
>>Unfortunately, after several minutes of searching on www.python.org
>>I didn't find them (which may denote that something is wrong with me
>>or with python.org). Search for new style classes,
>>Shalab <last name which spelling I cannot remember> and may be
>>even Dave Kuhlman <where the spelling is probably wrong>.
> 
> 
> I've read all the tutorials and resources pointed there from the Wiki
> as a starting point. All do a good job (some better than others) at
> explaining a lot of the technical issues. In fact, I've read both
> articles you and David Mertz have written, and found them great. The
> standard documentation is unfortunately up to this standard -- I've
> tried to find comprehensive references for it inside Python's
> reference manuals to no avail. This is something that really needs to
> be done there.
> 
> But the problem, in my particular case, was not with metaclasses per
> se, but with understanding the 'big picture'. With all respect for
> you, David Mertz, Alex Martelli, and all the others who helped to
> guide me through this (steep) learning curve -- you've done a great
> job, and I have to thank you all -- but most of the documentation
> seems to start 'from the inside'; in other words, from the perspective
> of someone that thoroughly understands how Python works, specially
> regarding the handling of declarations (classes, modules and
> functions), and that also knows what metaclasses are good for. For
> people that come from a different background (such as me), some of the
> explanations fail to 'ring a bell', which usually only happens after a
> lot of practical attempts and failures.

<snip>

> 
> It may be the case that, as I work more with metaclasses, I will tend
> towards a more natural vision of the process, and some of the nuances
> that are now relevant to me may become a thing of the past. But I
> think that I'm not alone on this, and that is the real problem faced
> by many newcomers to Python. 


It's even harder for a person coming to Python as a first programming 
language. Most technical documentation (not just with Python but with, 
for example, Linux) assumes that you already understand the topic at 
hand, just need a clarification of how-to. More explanation about 
"why-to" and "what does it mean" and underlying "how do I usefully think 
about this" is really helpful (in carefully measured doses... :-)

It's unfortunately common that people who understand the topic 
thoroughly (in any field, not just computers) don't think about the 
details consciously anymore, so it isn't that they *choose* not to 
mention it - it simply never occurs to them to mention it, because they 
"just know". This is a common issue in Training - the subject matter 
experts often are too "deep" in their subject to be able to explain it 
well to newbies.

I give a lot of credit to many of the folks in Python - at least they 
care whether they're getting across to newcomers. Some do better than 
others at explaining, but all of them seem to care. They *want* to know 
when something isn't clear and *why* so they can *fix* it! (Unlike my 
initial experience with some computer areas many years ago, where anyone 
who couldn't figure it out on their own was accused of being too stoopid 
to waste time on...)

Anna




More information about the Python-list mailing list