|
|
|
|
|
by dragonwriter
4490 days ago
|
|
Chainable mutating methods are not idiomatic Python; returning None is idiomatic for mutating methods. ISTR that the reasons here regard readability and clearly distinguishing mutations from queries, but in any case if you don't follow the idiom in libraries you create, they won't behave like Python's builtins and standard library, which, whatever you think about chaining on its own, will cause some context switching for most Python users when trying to work with it, increasing the cognitive load. |
|
At this point I think calling something idiomatic or Pythonic is a thought terminating statement. I need to see refutation.