bpo-33927: Pass stdin and stdout are default arguments to argpars infile/outfile#11992
bpo-33927: Pass stdin and stdout are default arguments to argpars infile/outfile#11992vstinner merged 1 commit intopython:masterfrom
Conversation
Argparse can handle default value as stdin and stdout for parameters as file type (infile, outfile).
|
@tirkarthi: Do you want to review this change? |
|
@vstinner Change looks good to me. While reviewing this PR seems like a similar change is also done at least for stdout in #7865 at https://github.com/python/cpython/pull/7865/files#diff-e94945dd18482591faf1e294b029a6afR25 . It assigns '-' by default and replaces '-' with |
|
This PR looks simpler than PR #7865. |
|
Hi, I think #7865 is a bugfix and not a new feature and this PR does not fix the link bpo issue as far as I can tell |
|
Hi @4383, can you clarify how is this related to the linked b.p.o report? |
|
@remilapeyre @vstinner mine isn't a bpo or a fix or something like that. But mine can help to a little bit to reduce the code complexity on #7865 by avoiding to check |
|
Ok, thanks for the clarification! There is an issue to use two This means that when I think it's not possible to use two |
|
@remilapeyre yeah good point I guess is a little bit more proper to assume that the default value is the Thoughts? |
|
With an |
|
@remilapeyre And you can continue your fix by removing Cf. my comments on yours #7865 |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
|
Thanks, I merged your PR. |
Argparse can handle default value as stdin and stdout for parameters
as a file type (infile, outfile).
https://bugs.python.org/issue33927