Does the Class UserGroup (issue 11588) exist for python 2.7 ?

Chris Angelico rosuav at gmail.com
Mon Jul 20 19:15:08 CEST 2015


On Mon, Jul 20, 2015 at 10:15 PM, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
> On 20/07/2015 12:27, CARANNANTE, MARTINE wrote:
>>
>> Hi
>> Could you tell me if the Class UserGroup (method add_usage_group to
>> support inclusive groups) exist for python 2.7 ?
>> The patch that I found on internet is only for python 3.
>> Thanks in advance for your answer
>> Best regards
>> *Martine Carannante
>> *
>
>
> Almost certainly no as the patch has never been commited, which is why
> http://bugs.python.org/issue11588 is till open.  Even if the patch were
> committed there is no guarantee that the patch will be back ported to 2.7.

There's almost a guarantee that it will NOT be backported to 2.7,
actually; it looks like a completely new feature. But if you're
interested, you might be able to apply the patch to a backported
argparse, such as:

https://pypi.python.org/pypi/argparse

Or just patch your own local version, but that's a bit dodgier.

If you're willing to migrate your code to Python 3, and you want this
feature, post in the tracker issue; even better, help with testing the
patch. The patch was updated for Python 3.5 roughly a year ago, and I
suspect that that version will still work; the lack of response after
that suggests that nobody has the time to test it and make sure it
works in all cases.

Since argparse is written in Python, you don't even need to play
around with a C compiler to test this. It's a nice easy thing to play
with - have a shot!

ChrisA


More information about the Python-list mailing list