New submission from Sworddragon:

In the argparse module I'm noticing that for example an optional argument and a 
positional argument can target the same namespace. Here is a testcase:

#!/usr/bin/python3 -BEOObbs
# coding=utf-8
import argparse
arguments = argparse.ArgumentParser()
arguments.add_argument('test', action = 'store_true', help = 'Description')
arguments.add_argument('--test', action = 'store_true', help = 'Description')
print(arguments.parse_args())


Maybe if argparse finds out that adding an argument would use the same 
namespace of an already added argument an exception should be thrown?

----------
components: Library (Lib)
messages: 252245
nosy: Sworddragon
priority: normal
severity: normal
status: open
title: Multiple names can target the same namespace
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25308>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to