Skip to content

typing.NamedTuple Subclassing throwing error #7

@jithinjk

Description

@jithinjk

I was trying out the code in the article, and, for the NamedTuple subclassing part, I received following error message:

>>> MaleStudent(name='Tommy Johnson', address='Main Street',age=22)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __new__() missing 1 required positional argument: 'sex'

Python version: Python 3.6.4 |Anaconda, Inc.| [MSC v.1900 64 bit (AMD64)] on win32

Here's the code: https://nbviewer.jupyter.org/gist/jithinjk/c255186041323726bf23838b5640c2f8

Is there any error with the syntax/code...?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions