[Python-3000] [Python-Dev] Issues with PEP 3101 (string formatting)

Jim Jewett jimjjewett at gmail.com
Mon Jun 25 16:07:26 CEST 2007


On 6/24/07, Paul Moore <p.f.moore at gmail.com> wrote:
> Count me as +0 on allowing a.b, and -1 on allowing a.b
> unless b contains leading underscores.

FWIW, I do want to allow a.b, because it means I can more easily pass
locals(), instead of creating a one-use near-boilerplate dictionary,
such as

{"a"=a, "b"=b, "name"=c.name}

I do like the "no attribues with leading underscores" restriction as
the default; these shouldn't be part of the public API.  If they are
needed, there should be an alias, and if there isn't an alias, then
... make it easy to override the policy.

If the restriction were actually "no magic attributes", so that
_myfile was fine, but __file__ wasn't, that would work even better --
except that it would encourage people to use __attributes__ when they
shouldn't, just to get the protection.

-jJ


More information about the Python-3000 mailing list