4 ms·
Am I wrong to assume there was nothing wrong with the previous code and these changes are gratuitous (e.g. just because we can)?
by crististm 8y ago
Am I wrong to assume there was nothing wrong with the previous code and these changes are gratuitous (e.g. just because we can)?
- int_19h 8y agoWhy not take a look at the examples in the PEP?
- crististm 8y agoI have but this doesn't answer my question: Am I wrong to say that a bunch of code that works is changed for no other reason than to exercise the new syntax?
- misnome 8y agoNo, you are not wrong to say that. Mainly because the pull itself explicitly says that it is using the standard library as an example of how the syntax could be used, with no intention to be merged.
- typon 8y agoDecorators, context managers, list comprehensions, multiple assignments, keyword arguments are all gratuitous. Should we remove them?
- crististm 8y agoWhich ones are you referring to?
- typon 8y agoThese are all merely syntactic sugar that replicate functionality available in Python that would otherwise be done in a more awkward way. This PEP is doing the same thing.
- crististm 8y agoMy question is about the value of this particular patch-set not about usefulness of the PEP. "The point of this PR is just to open discuss on coding style: discuss when assignment expressions are appropriate or not." There is no new code and the author's intention seems to be more than a "let's see how it would look like" patch. (Discussing where to use new syntax on existing code is a waste of time unless the intent is to apply the changes)