[Python-Dev] sys.implementation

Jeff Hardy jdhardy at gmail.com
Fri May 11 19:28:32 CEST 2012


On Thu, May 10, 2012 at 3:39 PM, Steven D'Aprano <steve at pearwood.info> wrote:
>> Aye. Add a rule that all implementation specific (i.e. not defined in
>> the PEP) keys must be prefixed with an underscore and I'm sold.
>
>
> So now we're adding a new convention to single underscore names? Single
> underscore names are implementation-specific details that you shouldn't use
> or rely on, except in sys.implementation, where they are an optional part of
> the public interface.

I've always seen _names as less implementation details and more 'here
be dragons; tread carefully'. I don't think adding a different
convention really changes that at all.

The underscore ones would (mostly) be implementation-specific anyway.
_clr_version is something only IronPython is going to have, for
example. If more than one implementation has something it can be
promoted to a non-underscore name, but I think that will be rare. Some
of the suggested metadata (like vcs_revision and build date) could
actually be required right out of the gate, and cache_tag should be
optional.

- Jeff


More information about the Python-Dev mailing list