GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — Docs: getopt is deprecated in Python 3.13 by hugovk · Pull Request #109438 · python/cpython Conversation
|
It's only soft deprecated! That's very different from being deprecated ;-) Some people already got upset that I soft deprecated getopt! https://docs.python.org/dev/glossary.html#term-soft-deprecated |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Personally I think it's a mistake to even soft deprecate getopt and optparse, when argparse has some bugs we're never going to fix, such as issue #53580. That leaves us without an argument parser that can handle "--foo --bar --bar", if --foo is an option that takes an argument and --bar is another option. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I suggest fixing argparse in this case. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
As the long (13 year!) discussion on the noted ticket points out, this isn't possible without rewriting argparse. And it's also impossible without breaking existing code or adding a separate parsing algorithm. So I don't think that's a viable course of action. Which leaves us without a usable, un-deprecated option parser. If that's our position, I think we should also soft deprecate argparse. I'd be okay with that. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
In this case, yep, it should be rewritten. If the issue exists for 13 years, maybe it's not really a big deal, otherwise a solution would pop up :-) Or people just moved to other modules which already handle this case.
The new behavior can be an opt-in option. Or if you prefer, the old behavior can be an opt-in option. Apparently, it's not possible to have a single default which fits all use cases, so having options make sure. For example, I like using
getopt and optparse are only soft deprecated. It's not a regular "hard" deprecation.
If you are concerned by the state of "parse command line arguments" modules in the stdlib, I suggest you opening a discussion on https://discuss.python.org/ to reach a larger audience, rather than commenting this closed PR. If there are better alternatives to argparse, the doc can link to them. We already do that for other modules:
https://docs.python.org/dev/library/urllib.request.html#module-urllib.request |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm only commenting here because I think the soft deprecation of getopt was a mistake without looking at the larger picture. I'll open a discussion on d.p.o when I have some time. Or maybe bring it up at the core sprint for starters. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.