Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Variable annotations were only added in Python 3.6. Defining a typed namedtuple in Python 3.5 looked like this:

    Foo = typing.NamedTuple('Foo', [('a', int), ('b', str)])


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: