Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builtin Functions only get scoped when called #39

Closed
cknv opened this issue May 18, 2015 · 1 comment
Closed

Builtin Functions only get scoped when called #39

cknv opened this issue May 18, 2015 · 1 comment

Comments

@cknv
Copy link

cknv commented May 18, 2015

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.

@MattDMo
Copy link
Owner

MattDMo commented May 26, 2015

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.

Matt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants