R. David Murray added the comment: I agree with Serhiy. Python is a programming language, not a shell. It seems to me that it should not be second guessing a constant specified by the programmer. If the programmer puts spaces in the specification string, Python should respect that. I have no idea why one would do that, but such an option *can* be specified in the command line invocation, even using the shell. And yes, misspecifying a constant is a common source of program bugs, but I think, as Serhiy pointed out, it would be worse to have some "obvious nonsense" fixed but not others.
Now, would we want to enhance getopt to validate the longopts in a more general way and raise an error? I'm not sure it is worth the effort, especially since getopt is explicitly emulating the C getopt, and it does not do so. ---------- nosy: +r.david.murray _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27619> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com