[Python-Dev] -Dwarn, long->double overflow (was RE: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.219,1.220)

Finn Bock bckfnn@worldonline.dk
Sun, 02 Sep 2001 18:08:04 GMT


[Greg Stein]

>Note that a general -Dkey=value option would be quite nice. They could all
>end in sys.startoptions or somesuch. 

Jython calls it sys.registry:

Jython 2.1b1 on java1.4.0-beta (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.registry
{python.path=d:\python\Python211\Lib}

>After the -D switches are processed,
>the startup code can look in the dictionary for "division" to determine what
>to do.
>
>sys.startoptions would be a generalized way to pass parameters into
>subsystems which otherwise have no control of the command line. (Apache 2.0
>uses this to pass params to the modules which handle request processing)  By
>using sys.startoptions, it would also be portable to systems which don't
>usually use a command line (Windows, Mac, GUIs, etc); they could potentially
>get those options from the registry or whatever.

Jython reads such options from the files "${sys.prefix}/registry" and
"${HOME}/.jython" in addition to the -D options on the command line.

regards,
finn