C Extension and multiple namespaces

P

Peter Kropf

I'm looking for a way to create multiple namespaces / dictionaries from
within a Python C extension. I'd like to replicate something like:

a\__init__.py
a\b\__init__.py
a\b\c\__init__.py

Where a\__init__.py import b and b\__init__.py imports c.

Python 2.2.3 (#1, Jul 9 2003, 16:15:35)
[GCC 3.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
import a
dir(a) ['__builtins__', '__doc__', '__file__', '__name__', '__path__', 'b']
dir(a.b) ['__builtins__', '__doc__', '__file__', '__name__', '__path__', 'c']
dir(a.b.c)
['__builtins__', '__doc__', '__file__', '__name__', '__path__']

I haven't been able to find any examples or other extension modules that do
anything like this, so it might not even be possible. But any help or
pointers would be appreciated.

Thanks.


- Peter

Special Projects Group, Legato Systems
3210 Porter Drive, Palo Alto, CA 94304
650-812-6081 Desk
408-482-9427 Cell
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top