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

list overloads don't handle nullability correctly #21

Open
chdsbd opened this issue Apr 15, 2021 · 1 comment
Open

list overloads don't handle nullability correctly #21

chdsbd opened this issue Apr 15, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@chdsbd
Copy link
Collaborator

chdsbd commented Apr 15, 2021

    class Post:
        user = fields.ListField(fields.StringField())

    post = Post()
    # should be 'list[str | None] | None' since user is not required and StringField is not required.
    reveal_type(post.user) # Revealed type is 'list[str]'

related: python/mypy#10312

@chdsbd chdsbd added the bug Something isn't working label Apr 15, 2021
@kodiakhq kodiakhq bot closed this as completed in #45 Jun 3, 2021
kodiakhq bot pushed a commit that referenced this issue Jun 3, 2021
To improve type safety we can remove these methods.

fixes #21
@chdsbd chdsbd reopened this Jun 3, 2021
@chdsbd
Copy link
Collaborator Author

chdsbd commented Jun 3, 2021

I closed the wrong issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant