This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Feature Request: Refactor collections.namedtuple
to typing.NamedTuple
#7009
Labels
needs repro
Issue has not been reproduced yet
Pyright (by extension, pylance), will raise reportUntypedNamedTuple for function-based namedtuples.
I'm requesting an editor action to easily refactor it into a class-based NamedTuple
This:
Would refactor into that:
(note the use of
__name__
when the class name and variable name don't match)This change being tedious (jaraco/skeleton#165) and not autofixable by linters (astral-sh/ruff#16491) is why I'm requesting this as a feature.
This can probably be exampled to other function-to-class transforms as well (enums come to mind)
The text was updated successfully, but these errors were encountered: