Monday 27 February 2017

coding style - Is it stylistically ok in Python to use l = list() rather than l = []?

My question is pretty short, is it bad python "style" to use l = list() rather than l = []? Or, similarly, d = dict() instead of d = {}?




Personally I find it more readable to write list(), dict(), set() etc. but I will avoid it if it is generally considered a "bad" way to write python code.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...