Thanks a lot for your comments Andrew,

I'm replying to your two emails using this, just to avoid confusions.

On the need of a PEP or a bug fix, well, I'm learning ;-) As I'm a good
student, I've written a draft PEP...

My idea was more a proposal to be discussed because wanting python -m
foobar instead of __main__.py is only an opinion. So, I'm not sure if
this can be considered as a bug. Also, I'm not sure to be "good enough"
to make proposal for code changes...

The portability issue can be removed by using f"{sys.executable} -m
foobar", but it is less accurate versus what the user has really typed.
What's better? Having a different behavior if /proc is available or not,
or always be "less accurate"?

Is it indended for end users? Well, IMHO, users of command lines are
technical users in 99% of the cases. End users only want web and GUI...
My use case is about commands which are automatically launched, or
manually by "well trained" people. Having the usage string which reflecs
the really used command is better to avoid confusions.

For that last point, again according to my opinion, the fact that it is
intended for end users or not is not the point. The real question is "do
argparse work as we expect or not?".

Best regards.

Le 23/08/19 à 17:50, Andrew Barnert a écrit :
> One more thing: from reading your proposal, it sounds like your actual issue 
> may be that you’ve got something you want to distribute to end-users who 
> aren’t Python experts to run as `python -m spam`, and the usage messages they 
> get back are confusing them?
>
> If so, why not just use a setuptools entry point script, so your users can 
> just run `spam` instead of `python -m spam`?
>
> That isn’t appropriate for scripts like pip or venv that are all about the 
> Python installation itself (someone with multiple Pythons installed will 
> almost certainly need to run python3.7 -m pip, python3.8 -m pip, pypy3 -m 
> pip, ~/bin/python -m pip, etc. and coming up with names for all of 
> those—especially automatically—would be silly), but that’s not the case for 
> most scripts.
>
> Sent from my iPhone
>
>> On Aug 23, 2019, at 08:16, Michael Hooreman <[email protected]> wrote:
>>
>> Hello,
>>
>> I have a proposal to improve support of __main__.py (python -m foobar)
>> invocation to argparse.ArgumentParser
>>
>> You can find attached a PEP draft.
>>
>> Unfortunately, I'm not very confident on how to add that PEP and ...
>> honnestly not very used to github.
>>
>> In short, can you help me and advise on this?
>>
>> Thanks a lot and best regards,
>> Michaël Hooreman
>>
>> <pep-9999.rst>
>> _______________________________________________
>> Python-ideas mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>> https://mail.python.org/mailman3/lists/python-ideas.python.org/
>> Message archived at 
>> https://mail.python.org/archives/list/[email protected]/message/VEGHR5GACYW7M6RVNEC323L2V43WJIKP/
>> Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/JFLCBJSN3CBYTQMIPSZ43PCSWVODQPKK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to