[issue10089] Add support for arbitrary -X options

Amaury Forgeot d'Arc report at bugs.python.org
Fri Oct 15 09:29:29 CEST 2010


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

Well, the syntax allows to pass either a string value (because it's a substring of the command line), or nothing.

When no value is passed, True seems better than None, because this allows the usage of the get() method::
    x = sys.xoptions.get('a')
or::
    if sys.xoptions.get('a'):
this returns None if the option was not set, True if set to a empty value, and a non-empty string if set to an actual value.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10089>
_______________________________________


More information about the Python-bugs-list mailing list