On Sat, Apr 28, 2012 at 12:22 AM, Chris Rebert <pyideas@rebertia.com> wrote:
On Fri, Apr 27, 2012 at 11:06 PM, Eric Snow <ericsnowcurrently@gmail.com> wrote:
* ``sys.implementation`` as a proper namespace rather than a dict. It would be it's own module or an instance of a concrete class.
So, what's the justification for it being a dict rather than an object with attributes? The PEP merely (sensibly) concludes that it cannot be considered a sequence.
At this point I'm not aware of the strong justifications either way. However, sys.implementation is currently intended as a simple collection of variables. A dict reflects that. One obvious concern is that if we start off with a dict we're binding ourselves to that interface. If we later want concrete class with dotted lookup, we'd be looking at backwards-incompatibility. This is the part of the PEP that still needs more serious thought.
Relatedly, I find the PEP's use of the term "namespace" in reference to a dict to be somewhat confusing.
In my mind a mapping is a namespace. I don't have a problem changing that to mitigate any confusion. Thanks for the feedback. -eric