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

stubgen: Use NamedTuple class syntax #10625

Merged
merged 4 commits into from
Jun 10, 2021

Conversation

srittau
Copy link
Contributor

@srittau srittau commented Jun 10, 2021

Description

Use typing.NamedTuple in stubgen, instead of collections.namedtuple.

Test Plan

I modified the existing tests and added another test for an empty namedtuple, to ensure that Any is not imported unnecessarily.

mypy/stubgen.py Outdated Show resolved Hide resolved
@JelleZijlstra JelleZijlstra merged commit 7e1eb3c into python:master Jun 10, 2021
@srittau srittau deleted the stubgen-namedtuple branch June 10, 2021 22:38
@srittau srittau mentioned this pull request Jun 11, 2021
JukkaL pushed a commit that referenced this pull request Jun 21, 2021
### Description

Use `typing.NamedTuple` in stubgen, instead of `collections.namedtuple`.

## Test Plan

I modified the existing tests and added another test for an empty namedtuple, to ensure that `Any` is not imported unnecessarily.
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