Message361326
As of Python v3.8.0 (specifically commit b1e4d1b603), specifying
`allow_abbrev=False` does not disable abbreviation for prefix
characters other than '-'.
--8<---------------cut here---------------start------------->8---
import argparse
parser = argparse.ArgumentParser(prefix_chars='+', allow_abbrev=False)
parser.add_argument('++long')
print(parser.parse_args(['++lo=val']))
--8<---------------cut here---------------end--------------->8---
Observed output (with b1e4d1b603 and current master):
Namespace(long='val')
Expected (and observed with b1e4d1b603^ and 3.7.3):
usage: scratch.py [+h] [++long LONG]
scratch.py: error: unrecognized arguments: ++lo=val
I will follow up with a PR to propose a fix. |
|
Date |
User |
Action |
Args |
2020-02-03 20:11:28 | kyleam | set | recipients:
+ kyleam |
2020-02-03 20:11:28 | kyleam | set | messageid: <1580760688.73.0.980793532046.issue39546@roundup.psfhosted.org> |
2020-02-03 20:11:28 | kyleam | link | issue39546 messages |
2020-02-03 20:11:28 | kyleam | create | |
|