What i would like to see :- what in python we can use that will help us write quality, concise code. Things like using list comprehensions, using magic methods, higher order functions(decorators...) and may be something else that i didn't knew.
What i would like to see :- what in python we can use that will help us write quality, concise code. Things like using list comprehensions, using magic methods, higher order functions(decorators...) and may be something else that i didn't knew.
They help make code more declarative rather than filling it with implementation logic. Anyone can just read the code and understand it instead of getting bogged down with the implementation. Especially list comprehensions. [len(i) for i in k] is much better than reading a for loop implementation looping through k and append len of each object in the loop to a result array
x = [] for i in k: x.extend(len(i))
is really, really easy for me to understand instantly, if I have just been writing an actuarial model using R, c++, c#, vba, sql, html, css and python for the day, which I have.
Shortness is not always conciseness, methinks.