[Python-Dev] Re: Draft: PEP for imports (original) (raw)

Jim Fulton jim at zope.com
Tue Mar 16 14:58:42 EST 2004


Summary of response: Yay!

Oh, I mean, +1.

I am one of those who likes Python's package system quite a bit, except for the issues addressed by this PEP.

I like the simple dot-prefix proposal. We use this now in Zope 3's configuration system to refer to modules within a package. A single leading dot refers to the current package, so:

".interfaces.IFoo"

refers to the IFoo object in the interfaces module within the current package.

Additional dots refer to containing packages, so:

"..interfaces.IFoo"

refers to the IFoo object in the interfaces module within the containing package of the current package.

We've never used more than two dots.

I don't really think that I've ever had problems counting up to two. I imagine that I could make it to three if pressed. ;)

I've never had problems seeing the leading dot (or dots).

I find this syntax to be simple and unobtrusive.

Jim

-- Jim Fulton mailto:jim at zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org



More information about the Python-Dev mailing list