[New-bugs-announce] [issue10871] argparse example use "file" instead of "open"

Baptiste Lepilleur report at bugs.python.org
Sun Jan 9 10:07:40 CET 2011


New submission from Baptiste Lepilleur <blep at users.sourceforge.net>:

In section "14.4.3.6. type" of the argparse module, the following code sample is given:

>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('foo', type=int)
>>> parser.add_argument('bar', type=file)
>>> parser.parse_args('2 temp.txt'.split())
Namespace(bar=<open file 'temp.txt', mode 'r' at 0x...>, foo=2)

The built-in "file" used for argument 'bar' no longer exists in python 3.2.

----------
assignee: docs at python
components: Documentation
messages: 125834
nosy: blep, docs at python
priority: normal
severity: normal
status: open
title: argparse example use "file" instead of "open"
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10871>
_______________________________________


More information about the New-bugs-announce mailing list