[issue10089] Add support for arbitrary -X options

2010-10-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed in r85772. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue10089] Add support for arbitrary -X options

2010-10-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a simpler version without comma-separated pairs. -- Added file: http://bugs.python.org/file19302/xopts3.patch ___ Python tracker ___ __

[issue10089] Add support for arbitrary -X options

2010-10-16 Thread Georg Brandl
Georg Brandl added the comment: I'd prefer "-X key[=val]" without the possibility to mention multiple key=val pairs, so that val can contain anything (commata in particular). Otherwise, the change looks fine to me. -- nosy: +georg.brandl ___ Python

[issue10089] Add support for arbitrary -X options

2010-10-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a new patch renaming the attribute to sys._xoptions, and adding some docs. -- Added file: http://bugs.python.org/file19252/xopts2.patch ___ Python tracker ___

[issue10089] Add support for arbitrary -X options

2010-10-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: > (It also makes it clear that other implementations aren't obliged to > implement *any* particular interface to the -X options. Requiring that > would go against the whole spirit of -X) Agreed. I'll update the patch to use sys._xoptions. --

[issue10089] Add support for arbitrary -X options

2010-10-15 Thread Nick Coghlan
Nick Coghlan added the comment: I suggest using sys._xoptions to make it clearer that this is for CPython specific internal implementation runtime tweaks. We're putting it in sys so *we* can get at it, not applications. (It also makes it clear that other implementations aren't obliged to impl

[issue10089] Add support for arbitrary -X options

2010-10-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc 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:

Re: [issue10089] Add support for arbitrary -X options

2010-10-15 Thread Senthil Kumaran
On Wed, Oct 13, 2010 at 07:01:40PM +, Antoine Pitrou wrote: > $ ./python -Xa,b=c,d -Xe,f=g=h -c "import sys; print(sys.xoptions)" > {'a': True, 'b': 'c', 'e': True, 'd': True, 'f': 'g=h'} Docs should be updated too. I see that the values could either be True or a string? Would this be perceive

[issue10089] Add support for arbitrary -X options

2010-10-15 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Why wouldn't they? A standard way to extend the command line options seems useful in all environments. Now the interpretation of these options are subject to variations of course... -- nosy: +amaury.forgeotdarc __

[issue10089] Add support for arbitrary -X options

2010-10-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Seems like a good idea to me. Would other VMs have to implement sys.xoptions > too? I don't think we should mandate that, no. -- ___ Python tracker __

[issue10089] Add support for arbitrary -X options

2010-10-14 Thread Éric Araujo
Éric Araujo added the comment: Seems like a good idea to me. Would other VMs have to implement sys.xoptions too? -- nosy: +eric.araujo ___ Python tracker ___ _

[issue10089] Add support for arbitrary -X options

2010-10-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: See issue10093 for a possible use case. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue10089] Add support for arbitrary -X options

2010-10-13 Thread Antoine Pitrou
New submission from Antoine Pitrou : It can be useful to enable or disable global Python features based on command-line flags. The -X is supposed to allow implementation-specific options but it is currently disabled for CPython. This patch allows to use -X for arbitrary options in CPython. The