[Python-Dev] some notes from the first part of the lang summit

Steven Bethard steven.bethard at gmail.com
Sun Feb 21 19:26:00 CET 2010


Thanks all for the updates. Sorry I can't make it to PyCon this year!

On Sun, Feb 21, 2010 at 1:30 AM, Eric Smith <eric at trueblade.com> wrote:
> There was also a quick discussion on maybe implementing optparse using
> argparse, then getting rid of the existing optparse.

I think the PEP pretty much already covers why this isn't possible. See:
http://www.python.org/dev/peps/pep-0389/#why-isn-t-the-functionality-just-being-added-to-optparse
Some of the reasons this would be really difficult include optparse's
baroque extension API and the fact that it exposes the internals of
its parsing algorithm, which means it's impossible to use a better
algorithm that has a different implementation.

On Sun, Feb 21, 2010 at 6:19 AM,  <skip at pobox.com> wrote:
> Would a 2to3 fixer be possible?
On Sun, Feb 21, 2010 at 6:29 AM, Benjamin Peterson <benjamin at python.org> wrote:
> I don't think so. There would be subtle semantic difference 2to3
> couldn't detect.

Yep, that's probably right. And I don't know how I'd write the fixers
for anyone who was using the old optparse extension API.

On Sun, Feb 21, 2010 at 5:45 AM, Guido van Rossum <guido at python.org> wrote:
> Maybe the best thing is to make optparse *silently* deprecated, with a
> big hint at the top of its documentation telling new users to use
> argparse instead, but otherwise leaving it in indefinitely for the
> benefit of the many existing users.

So basically do what the PEP does now, except don't remove optparse in
Python 3.5?  For reference, the current proposal is:

* Python 2.7+ and 3.2+ -- The following note will be added to the
optparse documentation:
    The optparse module is deprecated and will not be developed
further; development will continue with the argparse module.
* Python 2.7+ -- If the Python 3 compatibility flag, -3, is provided
at the command line, then importing optparse will issue a
DeprecationWarning. Otherwise no warnings will be issued.
* Python 3.2 (estimated Jun 2010) -- Importing optparse will issue a
PendingDeprecationWarning, which is not displayed by default.
* Python 3.3 (estimated Jan 2012) -- Importing optparse will issue a
PendingDeprecationWarning, which is not displayed by default.
* Python 3.4 (estimated Jun 2013) -- Importing optparse will issue a
DeprecationWarning, which is displayed by default.
* Python 3.5 (estimated Jan 2015) -- The optparse module will be removed.

So if I drop that last bullet, is the PEP ready for pronouncement?

Steve
-- 
Where did you get that preposterous hypothesis?
Did Steve tell you that?
        --- The Hiphopopotamus


More information about the Python-Dev mailing list