10000 Cython 3.0: issue calling a Cython function assigned as a class attribute · Issue #3529 · cython/cython · GitHub
[go: up one dir, main page]

Skip to content
Cython 3.0: issue calling a Cython function assigned as a class attribute #3529
@grlee77

Description

@grlee77

In testing scikit-image with current Cython master, we encountered a couple of test failures of the type:

FAILED skimage/io/tests/test_colormixer.py::TestColorMixerAdd::test_basic - TypeError: add() takes exactly 4 positional arguments (5 given)

This seems to be related to the use of a Cython function defined here in a test class which assigns the function as a class attribute.

I assume the 5th argument in the error message above is related to an additional self argument when called as a bound method? I don't know enough about the low level details of Python classes or Cython to speculate on the reason for this change in behavior.

Changing the test class to explicitly specify that cm.add is a static method as in:

class TestColorMixerAdd(ColorMixerTest):
    op = staticmethod(cm.add)

fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0