Skip to content

Add support for using intelligent indexing with Final-declared variables #6176

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

Conversation

Michael0x2a
Copy link
Collaborator

This pull request adds support for intelligent indexing with variables declared using an implicit Final. This makes the following code work as expected:

my_tuple: Tuple[int, str, bool]
idx: Final = 1
reveal_type(my_tuple[idx])  # Revealed type should be 'str'

This pull request adds support for intelligent indexing with variables
declared using an implicit Final. This makes the following code work
as expected:

```
my_tuple: Tuple[int, str, bool]
idx: Final = 1
reveal_type(my_tuple[idx])  # Revealed type should be 'str'
```
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@ilevkivskyi ilevkivskyi merged commit 9edc38d into python:master Jan 10, 2019
@Michael0x2a Michael0x2a deleted the support-intelligent-indexing-with-final-variables branch January 10, 2019 16:49
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.

2 participants