Skip to content

Support abstract collection types in Python#169

Merged
robgruen merged 3 commits into
mainfrom
supportCollectionTypes
Jul 6, 2026
Merged

Support abstract collection types in Python#169
robgruen merged 3 commits into
mainfrom
supportCollectionTypes

Conversation

@DanielRosenwasser

Copy link
Copy Markdown
Member

This change is part clean-up, part feature addition.

Now that microsoft/pyright#6582 is fixed, we can use all the collection types as values and support them as annotations.

Now that microsoft/pyright#6587 is fixed, we can directly reference Self.

@DanielRosenwasser DanielRosenwasser changed the title Support abstract collection types Support abstract collection types in Python Jan 8, 2024

@hillary-mutisya hillary-mutisya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@DanielRosenwasser DanielRosenwasser marked this pull request as draft March 21, 2024 01:43
…pport

Reconcile python_type_to_ts_nodes.py with current main: keep 'import typing_extensions' (now used throughout the file), add 'import collections.abc' and a direct 'Self' import. Enable abstract collection types in _LIST_TYPES/_DICT_TYPES and use 'Self' and 'origin in _DICT_TYPES'.

Replace the standalone tests/abstract_collections.py script with a proper syrupy snapshot test (tests/test_abstract_collections.py) matching current conventions; extend coverage to Iterable/Collection.
@robgruen robgruen marked this pull request as ready for review July 6, 2026 18:07
@robgruen robgruen merged commit 377d836 into main Jul 6, 2026
12 checks passed
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

Successfully merging this pull request may close these issues.

3 participants