Author zygocephalus
Recipients josh.r, mangrisano, paul.j3, zygocephalus
Date 2019-06-04.23:50:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <j66cZmZYcb2DXA9iGBg5-gCEBUWn44yKjejj6lE4Wmx4OH-MoCdYhGqce50s_6g7oXut8b1rgcds1T7HLQvabc377TA4y1VVw_Iqt8TLK_E=@protonmail.com>
In-reply-to <1559676438.99.0.552532886753.issue37150@roundup.psfhosted.org>
Content
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 <report@bugs.python.org> wrote:

>
>
> Michele Angrisanomichele.angrisano@gmail.com 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 report@bugs.python.org
> https://bugs.python.org/issue37150
History
Date User Action Args
2019-06-04 23:50:25zygocephalussetrecipients: + zygocephalus, paul.j3, josh.r, mangrisano
2019-06-04 23:50:25zygocephaluslinkissue37150 messages
2019-06-04 23:50:25zygocephaluscreate