You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noted that builtin functions only get scoped when they are called, that means that there is a difference between len and len(), which in this case there is (one is being called), but that should not mean that len is no longer len or is any different once it gets called.
But say I have a sequence of sequences (strings, lists, whatever), that I want to sort by their length: sorted(sequence, key=len), the only scopes len gets are those to mark it as an argument of a function, not a builtin itself.
I think it could be useful to have it marked as a builtin function, even when it it not called.
len can btw be replaced with most of the builtin functions, except for the ones are also are types, such as str, list, and bytes. Sadly to me they muddy the waters quite a bit and makes this otherwise simple issue a bit more complicated as also presented in #16. Personally I have my types and builtins coloured the same way, so I have little opinion (yet) about the difference of types and builtin functions - to me, they are all the same.
The text was updated successfully, but these errors were encountered:
Hi,
Thanks for your feedback. This has been a topic of discussion in #16, if you'd like to contribute there. I am considering implementing this in a future release.
I have noted that builtin functions only get scoped when they are called, that means that there is a difference between
len
andlen()
, which in this case there is (one is being called), but that should not mean thatlen
is no longerlen
or is any different once it gets called.But say I have a sequence of sequences (strings, lists, whatever), that I want to sort by their length:
sorted(sequence, key=len)
, the only scopeslen
gets are those to mark it as an argument of a function, not a builtin itself.I think it could be useful to have it marked as a builtin function, even when it it not called.
len
can btw be replaced with most of the builtin functions, except for the ones are also are types, such asstr
,list
, andbytes
. Sadly to me they muddy the waters quite a bit and makes this otherwise simple issue a bit more complicated as also presented in #16. Personally I have my types and builtins coloured the same way, so I have little opinion (yet) about the difference of types and builtin functions - to me, they are all the same.The text was updated successfully, but these errors were encountered: