[Python-Dev] Re: Cuddly constants seek loving, stable home (original) (raw)

Ka-Ping Yee ping@lfw.org
Thu, 23 Aug 2001 01:37:51 -0700 (PDT)


On Thu, 23 Aug 2001, Tim Peters wrote:

So I propose a new builtin module, sysconsts. The underscore is to announce its obscure internal nature. I propose only to expose the COxxx #defines at the start, but of course others could be added.

Just a suggestion, but how about sys.consts? Like os.path, as in sys.consts.CO_NESTED, sys.consts.CO_FUTURE_DIVISION, etc. So there's only one new object in sys, and it can contain the weird internal stuff. :)

(Errr... the names are rather weird. CO_NESTED_SCOPES, CO_TRUE_DIVISION, and CO_GENERATORS would be better. If i had my druthers it would be

CO_* constant       FUTURE_* constant       __future__ symbol

CO_NESTED_SCOPES    FUTURE_NESTED_SCOPES    nested_scopes
CO_GENERATORS       FUTURE_GENERATORS       generators
CO_TRUE_DIVISION    FUTURE_TRUE_DIVISION    true_division

instead. If CO_NESTED, why not CO_TRUE? If CO_GENERATORS_ALLOWED, why not CO_NESTED_SCOPES_ALLOWED?)

Anyway.

Hmm, as a side thought, perhaps keywords and tokens should go here too (sys.keywords, sys.tokens) instead of having to keep separate .py files in sync with the interpreter core.

-- ?!ng