You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
optparse is deprecated in python2.7 and 3.2+. Argparse has replaced it (and is
available on pypi for older versions).
The use of optparse should be gradually deprecated in repo. Of course this
needs to be done carefully since others write subcommands.
A wrapper can be written around argparse to enable the most common uses of
optparse so we don't break everyones commands. This won't work for all though,
such as with callbacks that use parser.largs or rargs.
A class attribute can also be set to say if a command fully supports argparse,
enabling us to skip the wrapper altogether.
Anything that doesn't touch on subcommands can be directly converted to use
argparse safely.
Since argparse supports subparsers, it will simplify the the process used for
selecting the subcommand.
In time, support for optparse should be fully removed, starting with warnings
when optparse methods are used, then forcing an option to be set to allow
optparse methods to be used, finally fully removing the wrapper.
Since optparse isn't set to be removed from py3.5, I would recommend a time
frame of 2 years from when the subcommands are changed to use argparse.
Original issue reported on code.google.com by [email protected] on 21 Feb 2015 at 6:27
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 21 Feb 2015 at 6:27The text was updated successfully, but these errors were encountered: