We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have some module defining a NamedTuple:
NamedTuple
nmt.py:
nmt.py
from typing import NamedTuple class Employee(NamedTuple): name: str id: int
and a simple setup.py:
setup.py
from distutils.core import setup from Cython.Build import cythonize setup(ext_modules=cythonize("nmt.py"))
I build the module like this
python setup.py build_ext --inplace
The result class Employee can't be properly instantiated:
Employee
>>> from nmt import Employee >>> Employee("a", 1) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: __new__() takes 1 positional argument but 3 were given >>> Employee("a") Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: __new__() takes 1 positional argument but 2 were given >>> Employee() Employee()
The text was updated successfully, but these errors were encountered:
Duplicate of #2552.
Sorry, something went wrong.
does any one has alternative plan? this usage is heavily used in the project.,and I don't know how to
No branches or pull requests
I have some module defining a
NamedTuple
:nmt.py
:and a simple
setup.py
:I build the module like this
The result class
Employee
can't be properly instantiated:The text was updated successfully, but these errors were encountered: