This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jacksonriley
Recipients LewisGaul, abacabadabacaba, ezio.melotti, jacksonriley, malin, mrabarnett, serhiy.storchaka
Date 2019-11-04.22:02:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572904949.22.0.183185261375.issue23692@roundup.psfhosted.org>
In-reply-to
Content
I've got a bit confused and am doubting myself - is the below output expected?
>>> m = re.match('(?:()|(?(1)()|z)){1,2}(?(2)a|z)', 'a')
>>> m.groups()
('', '')
>>> m = re.match('(?:()|(?(1)()|z)){1,2}(?(1)a|z)', 'a')
>>> m.groups()
('', None)

The first pattern doesn't behave as I would (probably naively expect) given Matthew's explanation of this bug - wouldn't the bug cause the match to fail with {1,2} as well?
Also, it seems odd that changing the condition in the if clause should change what gets captured.

Anyone have any thoughts?
History
Date User Action Args
2019-11-04 22:02:29jacksonrileysetrecipients: + jacksonriley, ezio.melotti, mrabarnett, abacabadabacaba, serhiy.storchaka, malin, LewisGaul
2019-11-04 22:02:29jacksonrileysetmessageid: <1572904949.22.0.183185261375.issue23692@roundup.psfhosted.org>
2019-11-04 22:02:29jacksonrileylinkissue23692 messages
2019-11-04 22:02:29jacksonrileycreate