Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Add IsExact to collection interface, check when deciding to use __all__ #886

Merged
merged 4 commits into from
Apr 8, 2019

Conversation

jakebailey
Copy link
Member

Fixes #881.

This adds IsExact to IPythonCollection, which is true when Contents contains an exact representation of the contents, meaning that the values are set and are known. This boolean is propagated around, and used when looking up __all__.

Tensorflow broke because it assigns __all__ via a comprehension; the comprehension evaluator doesn't actually populate a real collection, instead producing a collection which contains a single member. This could be improved in the future, but by not setting IsExact true when that collection is produced, that incomplete value won't be used when looking at __all__.

@jakebailey
Copy link
Member Author

This too will conflict with the refs PR due to the LocationInfo uses.

@jakebailey jakebailey merged commit 41c0927 into microsoft:master Apr 8, 2019
@jakebailey jakebailey deleted the exact-collections branch April 8, 2019 17:30
jakebailey added a commit to jakebailey/python-language-server that referenced this pull request Nov 1, 2019
…__ (microsoft#886)

* add IsExact to collection interface, check when deciding to use __all__

* todo comment about exact comprehensions

* remove extra spaces

* drop protected set
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants