4 ms·
I do agree that it's probably unnecessary here, but in many cases assigning to variables can be a good thing in the name of readability. You can give the variab
by kivle 4y ago
I do agree that it's probably unnecessary here, but in many cases assigning to variables can be a good thing in the name of readability. You can give the variable a name, explaining it's purpose. If you directly return an expression, the reader will have to parse and understand the purpose of the expression to understand the context.
- OJFord 4y agoAs of 3.10, the walrus operator is your friend if you really want to name to explain: return cached_foobar := cache.get("foobar").data