[issue25475] use argparse instead of getopt

2015-10-25 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

it's not for the pleasure, but there are two api for the command line. getopt 
and argparse. so in this case, what's the reason to keep both ? in particular 
if the documentation of getopt has a note with an alternative.

maybe to keep the backward compatibility, but in this case, maybe we can start 
to deprecate getopt in favour of argparse.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25475] use argparse instead of getopt

2015-10-25 Thread R. David Murray

R. David Murray added the comment:

This was discussed when argparse was included in the standard library, and the 
conclusion was that getopt serves a different purpose than argparse and should 
not be deprecated.  argparse is mentioned as an alternative since in many cases 
it is to be preferred, but there are cases where getopt is the better choice.  
(I myself have a command line parsing library (not yet published) that uses 
getopt as its base.)

As far as using argparse in the standard library, yes, we convert modules on a 
case by case basis when someone has the interest and the time to write tests 
for the existing command line behavior before doing the conversion.  And in 
every case we have still introduced bugs when the conversion was released, so 
this should not be done lightly (ie: we usually only do it when introducing new 
functionality or fixing a bug).

--
nosy: +r.david.murray
stage:  -> resolved

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25475] use argparse instead of getopt

2015-10-25 Thread SilentGhost

SilentGhost added the comment:

This seems like a change for the sake of change. I think any module that 
requires argparse features can be moved in its own time.

--
nosy: +SilentGhost
resolution:  -> rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25475] use argparse instead of getopt

2015-10-25 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

and optparse.

In fact, we have getopt, optparse and argparse. 3 API for the command line.

optparse is marked as deprecated.
maybe we can add getopt in this list.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25475] use argparse instead of getopt

2015-10-25 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

not sure, but in the documentation, there is a note
"Module argparse: Alternative command line option and argument parsing library."

may be it's time to move from getopt to argparse and mark getopt as deprecated.

We have to modify 45 files, but I can submit a separated patch for each file.

ack "import getopt" -l | wc -l
  45

--
components: Library (Lib)
messages: 253429
nosy: matrixise
priority: normal
severity: normal
status: open
title: use argparse instead of getopt
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com