IMO all those examples are less readable than writing it in an imperative way using good function and variable names.
Also, len() is a Python convention and a built-in function that calls __len__() on that object. It’s even more established than .length in JS, so I really don’t see why someone would expect anything else. And even then, one could call my_list.__len__() if they really wanted to be sure and have that “left to right” bonus.
IMO all those examples are less readable than writing it in an imperative way using good function and variable names.
Also,
len()
is a Python convention and a built-in function that calls__len__()
on that object. It’s even more established than.length
in JS, so I really don’t see why someone would expect anything else. And even then, one could callmy_list.__len__()
if they really wanted to be sure and have that “left to right” bonus.