Metaclass with name overloading.

Jacek Generowicz jacek.generowicz at cern.ch
Tue Sep 28 03:47:51 EDT 2004


Carlos Ribeiro <carribeiro at gmail.com> writes:

> On 27 Sep 2004 13:33:33 +0200, Jacek Generowicz
> <jacek.generowicz at cern.ch> wrote:

[...]

> > I was wondering whether it would be possible to achieve this by
> > forcing Python to use some dicitonary proxy (which accumulates
> > values, rather that keeping just the last value to be associated
> > with a key), instead of dict, when executing the class definiton?

[...]

> No, you can't, and it's not just a parser issue. Python uses direct
> C calls to the native dict type. It's hard coded,

I feared this would be the case.

> p.s. In the particular case of the original poster, I'm wondering
> what kind of application did he had in mind.

A standalone, lightweight SWIG-like tool, in this case. But in
general, I've had cause to wonder about declarative syntaxes in Python
every now and then.

Thanks, to all who contributed ideas to the thread, particularly Alex,
Thomas and Lenard.



More information about the Python-list mailing list