[Python-Dev] -Dwarn, long->double overflow (was RE: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.219,1.220)
Guido van Rossum
guido@python.org
Sun, 02 Sep 2001 17:28:13 -0400
> > Would it make sense to define a Jython property for the division
> > behavior? Then I could change the syntax to -Ddivision=old,
> > -Ddivision=warn, -Ddivision=new. That's a bit long, but acceptable.
>
> This would be similar to compilers which use -Dsym[=value]. Apache has a
> similar -Dsym[=value] option.
>
> Note that a general -Dkey=value option would be quite nice. They could all
> end in sys.startoptions or somesuch. 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.
Yes, would be nice - but I have no time for that if I want to make a
release this week (or later).
I think I'll go for something stupid and simple now, like just using
-q to turn on division warnings, and nothing else (the -Dnew option is
not very useful I think).
--Guido van Rossum (home page: http://www.python.org/~guido/)