3 ms·
This seems pretty nuts. I'm with Steve Dower here - make all parameters allowed as keyword arguments. Guido's objection that "writing len(obj=configurations) i
by twic 8y ago
This seems pretty nuts. I'm with Steve Dower here - make all parameters allowed as keyword arguments.
Guido's objection that "writing len(obj=configurations) is not something we want to encourage" makes not one iota of sense. Allowing it is not encouraging it.
There's mention of one bug which allegedly could have been fixed with positional-only parameters:
https://bugs.python.org/issue9137 https://bugs.python.org/issue9137
The bug here is that dicts have an update method which you can call two ways, by passing a single dict, or with keyword arguments, and if you try to call the single-dict version using a named parameter, it's not clear what should happen, and at one point, for OrderedDict, it could end up throwing an exception.
But the mistake here isn't confusing parameters, it's having a single method that you can call in two different ways. That sort of thing might fly in Perl, but it's a source of ambiguity and confusion that, IMHO, is not up to Python's standards.