Skip to content

ERROR: The name '__str__' is reserved for a special method. #1797

@ghost

Description

Good day,

I have a helper class in my package that replaces the str of the input class when used as a decorator. I am in the process of cythonizing the project and I am encountering such error:

[1/1] Cythonizing src/auto_str.py

Error compiling Cython file:
------------------------------------------------------------
...
def auto_str(cls):
    def __str__(self):
   ^
------------------------------------------------------------

src\auto_str.py:2:4: The name '__str__' is reserved for a special method.

A simplified version of the project is attached here.

What would be the best approach for this? I'm pretty new with Cython, apologies if I missed some concepts.

Thank you for your patience and hard work!

Using Cython 0.25.2 with Win 7 x64 and Python 3.4.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions