Is it? Why introduce an additional conversion from not list means empty list that u have to hold in your head. I want to check length I check length I would argue is easyer to comprehend.
Because that’s a fundamental aspect of Python. When you’re using a language, you should be familiar with the truthiness values. In Python, it’s pretty sane:
[], {}, set(), "", None, False0 and related values are all “falesy”
everything else is truthy
Basically, if you have non-default values, it’s truthy. Why wouldn’t you trust basic features of the language?
Is it? Why introduce an additional conversion from not list means empty list that u have to hold in your head. I want to check length I check length I would argue is easyer to comprehend.
Because that’s a fundamental aspect of Python. When you’re using a language, you should be familiar with the truthiness values. In Python, it’s pretty sane:
[]
,{}
,set()
,""
,None
,False
0
and related values are all “falesy”Basically, if you have non-default values, it’s truthy. Why wouldn’t you trust basic features of the language?