How can I make typing.NamedTuple play nicely with PyCharm?
collections.namedtuple works fine:
import collections
B = collections.namedtuple('B', ['i'])
b = B(1)
b.i
but typing.NamedTuple doesn't:
import typing
A = typing.NamedTuple('A', [('i', int)])
a = A(1)
a. # No suggestions
You should better direct such questions to the PyCharm bug tracker. Your problem already has an open ticket though.
PyCharm plays very well with the prefered syntax
class A(NamedTuple):
i: int
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With