[Python-Dev] metaclass insanity

David Abrahams dave@boost-consulting.com
04 Nov 2002 19:14:16 -0500

Guido van Rossum <guido@python.org> writes:

> > > Can someone provide a reason why you'd want to use nested classes?
> > 
> > "Namespaces are one honking great idea -- let's do more of those!"
> Yeah, but I simply don't think that a Python class is a good mechanism
> for grouping arbitrary names together.  We've got packages and modules
> for that.

If I write a container it seems reasonable to nest its iterator class.

> > > I've never felt this need myself.  What are the motivations?
> > 
> > My people want it so they can mirror the structure of their C++ code
> > with their Python wrappers, among other things.
> This sounds unpythonic, and confirms my expectation that this is an
> example of trying to write C++ in any language. :-)

A latent hatred of C++ sure do come in handy if'n there's an idea we
don't like floatin' around, don't it? 

If we define "Pythonic" narrowly enough, we can make sure it never
grows up to be another one of those `multiparadigm' programming

kill-all-the-other-nasty-languages-(or-maybe-this-one)-ly y'rs,

                    David Abrahams
dave@boost-consulting.com * http://www.boost-consulting.com