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

Need to handle cases where attribute may not be a symbol we have #5

Open
CJ-Wright opened this issue Jan 29, 2021 · 1 comment
Open

Comments

@CJ-Wright
Copy link
Member

For example

# code from xyz
# b = {'hi': 'world'}

from xyz import b

a = b.values()

We would observe the symbol as xyz.b.values but I don't think we'll know that b has a valid symbol values. In this case we should maybe state that once we get to the end of our chain of attributes, then we stop looking. The length of the chain depends on the type of symbol: modules can have as many as needed, functions zero, constants zero, classes one. We could handle this if we knew that b was a dict, but we'd have to have that metadata in hand. And that could be very difficult if we got b from a function where the return type could be anything.

@CJ-Wright
Copy link
Member Author

That approach does produce a nasty blind spot, where we don't see changes in type (for instance b moves from dict to list) as API changes, although that would certainly break the example code and need to be pinned accordingly.

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

1 participant