Getopt and optparse vs argparse

I know it will take longer and be more difficult, but IMHO it’s better to execute your plan without marking argparse as provisional or un-deprecating optparse. Deprecating and un-deprecating optparse sends a confusing message to users, especially as these bugs have existed the entire time that argparse has been in the standard library. I agree the bugs are bad - and only get more terrifying when you debug them and realise how argparse really works - but they’re edge cases that don’t affect most users, and often have simple workarounds, like re-arranging or quoting arguments. Just my 2c.

(Admittedly I quite like argparse and I’ve been using it since before it was in the standard library, because its interface is better than getopt, and it parses positional arguments unlike optparse.)

Let me know if I can help write some tests or review some changes!

12 Likes