[docs] Bug in documentation for argparse type.

Robert Iannucci iannucci at google.com
Fri May 24 22:50:09 CEST 2013


Hello!

In the very first example for argparse type, there's a type being set to
'open' (the python builtin). However, immediately following that, the
documentation suggests using argparse.FileType instead.

http://docs.python.org/dev/library/argparse.html#type

While open technically works for type (for read-only files), it may make
sense for the first example to demonstrate the 'right' way so users aren't
tempted to do type=lambda x: open(x, 'w') instead of argparse.FileType('w').

Cheers,
Robbie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20130524/43547ee0/attachment-0001.html>


More information about the docs mailing list