New issue

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

Cython 0.26 fails to compile an overloaded method inherited by a std::set subclass #1868

Open
orivej opened this Issue Sep 11, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@orivej
Contributor

orivej commented Sep 11, 2017

Compiling the following example with Cython 0.26.1 and current master fails at the last line:

from libcpp.set cimport set

cdef cppclass myset[T](set[T]):
    pass

cdef f():
    cdef set[int] set1
    cdef myset[int] set2
    set1.insert(1)
    set2.insert(1)

The error is:

Error compiling Cython file:
------------------------------------------------------------
...

cdef f():
    cdef set[int] set1
    cdef myset[int] set2
    set1.insert(1)
    set2.insert(1)
              ^
------------------------------------------------------------

x.pyx:10:15: Call with wrong number of arguments (expected 2, got 1)

The definition of set in the Cython distribution contains:

cdef extern from "<set>" namespace "std" nogil:
    cdef cppclass set[T]:
        pair[iterator, bint] insert(const T&) except +
        iterator insert(iterator, const T&) except +
@orivej

This comment has been minimized.

Show comment
Hide comment
@orivej

orivej Sep 12, 2017

Contributor

git bisect tells that this example was broken since Cython 0.25 by the fix for #1458 in 1f98bcd.

Contributor

orivej commented Sep 12, 2017

git bisect tells that this example was broken since Cython 0.25 by the fix for #1458 in 1f98bcd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment