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

Methods and Functions Encapsulation #6

Open
antunesleo opened this issue Oct 21, 2021 · 3 comments
Open

Methods and Functions Encapsulation #6

antunesleo opened this issue Oct 21, 2021 · 3 comments

Comments

@antunesleo
Copy link

Great Initiative folks. Do you have any plans to expand this library to also enforce encapsulation in methods and functions?

@kitchoi
Copy link
Owner

kitchoi commented Oct 22, 2021

It was one of the ideas mentioned when the project was first introduced to peers. At the moments there are no plans except an acknowledgment that it would be a challenging task to do so statically. Static checking is a requirement here to avoid any runtime penalty, which could be a blocker to adoptions.
Proposals and/or pull requests would be very welcome!

@antunesleo
Copy link
Author

Totally agree. I've never implemented any kind of text/code static checker before, but is something that looks very interesting to study. Do you have any idea/tip on how this can be done?

@kitchoi
Copy link
Owner

kitchoi commented Oct 26, 2021

I haven't done a thorough search for solutions. Just an idea: may be to take a look at using Jedi API https://jedi.readthedocs.io/en/latest/docs/api.html#jedi.Script to infer the scope context for a particular name reference, then go from there to determine whether a method/function whose name has a preceding underscore belongs to the same module.

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

No branches or pull requests

2 participants