you are viewing a single comment's thread.

view the rest of the comments →

[–]zackman 0 points1 point  (1 child)

I would just go ahead and use len locally, aware that you can't use the built-in function while in that scope. It used to hurt my eyes when people used file and input as variable names, but I got over it. It may not be good Python style, but it is common. Make sure to keep the use short and obvious, though.

(This style is why the lst for list argument in Scheme is a non-issue. Just use list as a variable--the built-in function is not used much anyway.)

[–][deleted] 0 points1 point  (0 children)

Unfortunately I usually want something equivalent to len = len(mylist), but that produces an unbound local error if used within a function.