stubgen: Use NamedTuple class syntax by srittau · Pull Request #10625 · python/mypy · GitHub
Skip to content

stubgen: Use NamedTuple class syntax#10625

Merged
JelleZijlstra merged 4 commits into
python:masterfrom
srittau:stubgen-namedtuple
Jun 10, 2021
Merged

stubgen: Use NamedTuple class syntax#10625
JelleZijlstra merged 4 commits into
python:masterfrom
srittau:stubgen-namedtuple

Conversation

@srittau

@srittau srittau commented Jun 10, 2021

Copy link
Copy Markdown
Contributor

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.

Comment thread mypy/stubgen.py
Comment thread mypy/stubgen.py Outdated
@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