This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: cython nametuple TypeError
Type: behavior Stage: resolved
Components: Cross-Build Versions: Python 3.6
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Alex.Willmer, beruhan, gvanrossum, levkivskyi, serhiy.storchaka
Priority: normal Keywords:

Created on 2019-04-10 07:24 by beruhan, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg339828 - (view) Author: beruhan (beruhan) Date: 2019-04-10 07:24
I have a class that inherits from NamedTuple,I have compile it to pyd file on windows use cython,when I import the class  and create a object in another py file,It throws error 'TypeError: __new__() takes 1 positional argument but 4 were given'

when I don't compile it to pyd,It can use normally,How to deal with it?
msg339829 - (view) Author: beruhan (beruhan) Date: 2019-04-10 07:26
the class definitions as follows:
from typing import NamedTuple


class Info(NamedTuple):
    service: str
    damage: str
    privilege: str


info = Info("http", "no", "no")
msg339833 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-04-10 07:38
This is a bug tracker of CPython -- the C implementation of Python. For bugs in Cython use different tracker.
History
Date User Action Args
2022-04-11 14:59:13adminsetgithub: 80765
2019-04-10 07:38:51serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg339833

resolution: third party
stage: resolved
2019-04-10 07:26:59beruhansetmessages: + msg339829
2019-04-10 07:24:54beruhancreate