[New-bugs-announce] [issue22049] argparse: type=<callable> doesn't honor nargs > 1

Chris Bruner report at bugs.python.org
Wed Jul 23 19:16:22 CEST 2014

New submission from Chris Bruner:

>From the documentation, I think that argparse should pass the entire nargs-long string to the "type=" callable. Instead, it only passes the first argument (of nargs), making it impossible within argparse's framework to check for a tuple of mixed types, e.g., 2 ints and a float (my case), or a string and three numbers, etc.

See attached reproducer.

files: argparse_typedef_bug.py
messages: 223748
nosy: Chris.Bruner
priority: normal
severity: normal
status: open
title: argparse: type=<callable> doesn't honor nargs > 1
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file36048/argparse_typedef_bug.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list