Proposal for removing self

Alex Martelli aleaxit at yahoo.com
Fri Aug 27 02:35:43 EDT 2004


Ravi Teja Bhupatiraju <webraviteja at yahoo.com> wrote:
   ...
> Aren't you being a bit touchy Alex? Now I am glad that I did not
> mention my wish list on properties and DBC :-). However, your post has
> been quite informative. So I can live with that.

Exactly: far from being "touchy", I have been constructive.  Coming back
to c.l.py after months of absence, and finding that, as usual, instead
of trying to use Python to best effect, people with mediocre Python
mastery keep trying to change Python (generally trying to break some of
the best aspects of it, because they don't understand enough Python to
see why they're good) was of course depressing -- I'm proud of myself
for reacting constructively rather than lashing out or going away again
at once.


> I wish I could rise up to your challenge and do all that stuff.
> Regretfully, my Python skills don't extend to metaclasses and
> especially "byte code hacking". Maybe you will explain those in your
> next edition of the cookbook :-).

Bytecodehacks are implementation-specific, and specific to one version
of Python (they wouldn't apply to Jython, IronPython, ...), so I'm not
going to write about them -- and you don't need to master them to try
out one of the changes you want, the __private__ idea.  Metaclasses are
quite another issue: they are, even conceptually, absolutely fundamental
to understanding Python's object model, and if you do not understand the
object model, your knowledge of Python is shallow -- FAR too shallow for
you to _sensibly_ propose changes to Python, in my opinion.

So I did cover metaclasses in "Python in a Nutshell" as well as in
dedicated presentations (you can find the presentations' PDFs on the
usual site, www.strakt.com) and I will probably select a few metaclass
recipes for the second edition of the Cookbook.


> That said, I only could find one set of docs that could be called a
> <tutorial> on metaclasses. Those were by David Mertz and Michele
> Simionato. I could not get through them. I took comfort in the
> statement "Metaclasses are deeper magic than 99% of users should ever
> worry about" from the document. I am still looking for something I can
> understand.

At least 99% of users should not propose changes to Python.  Many of
them would be well served by undersanding metaclasses, even if they
never need to write custom metaclasses -- they shouldn't _worry_ about
them, since there's nothing to worry about, but understanding and
worrying are different things.  Which is why I cover metaclasses in
books, articles, posts (use google groups to look for my post that
mention metaclass, there were quite a few), and presentations.


Alex



More information about the Python-list mailing list