Custom namespaces
Michele Simionato
michele.simionato at gmail.com
Thu Aug 6 23:29:35 EDT 2009
On Aug 2, 6:46 am, Chris Rebert <c... at rebertia.com> wrote:
> > Is there any way to install a custom type as a namespace?
>
> For classes/objects, yes, using metaclasses.
> See the __prepare__() method in PEP 3115:http://www.python.org/dev/peps/pep-3115/
Here is an example of usage:
http://www.artima.com/weblogs/viewpost.jsp?thread=236234
http://www.artima.com/weblogs/viewpost.jsp?thread=236260
(yes, it only works for Python 3+)
More information about the Python-list
mailing list