Demid <[email protected]> added the comment:
If you will run `python test.py hello.txt, where test.py is:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('echo', type=argparse.FileType)
args = parser.parse_args()
print(args.echo)
You will receive:
FileType('hello.txt')
I think that can be confusing for someone who will forget to invoke FileType
constructor.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, June 4, 2019 10:27 PM, Michele Angrisano <[email protected]>
wrote:
>
>
> Michele [email protected] added the comment:
>
> Reading the examples in the doc, it's clear the behavior when FileType takes
> an argument. What's the behavior of FileType when is called without any
> argument?
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> nosy: +mangrisano
>
> Python tracker [email protected]
> https://bugs.python.org/issue37150
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37150>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com