Skip to content
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

Cannot rename C++ template class #3018

Open
pitrou opened this issue Jun 27, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@pitrou
Copy link
Contributor

commented Jun 27, 2019

This is with Cython 0.29.8

Error compiling Cython file:
------------------------------------------------------------
...
        c_bool IsPlasmaObjectExists()
        c_bool IsPlasmaObjectNonexistent()
        c_bool IsPlasmaStoreFull()

cdef extern from "arrow/result.h" namespace "arrow" nogil:
    cdef cppclass CResult[T] "arrow::Result":
                            ^
------------------------------------------------------------

pyarrow/includes/common.pxd:73:29: Syntax error in C++ class definition
@samaingw

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2019

Ok, so this is possible but it may not be very logical.
In the parsing code, for c++ classes, the cname handler goes before the template handler.

So cdef cppclass CResult[T] "arrow::Result" should be rewritten as cdef cppclass CResult "arrow::Result"[T] (tested on my machine, it compiles and generate the code as expected).

@pitrou

This comment has been minimized.

Copy link
Contributor Author

commented Jul 5, 2019

Ha... I had never thought of that. @jorisvandenbossche would you like to take a look and simplify the current hack in the Arrow codebase?

@jorisvandenbossche

This comment has been minimized.

Copy link

commented Jul 5, 2019

Will take a look. It's what you introduced in apache/arrow#4707 right?
(opened JIRA for it: https://issues.apache.org/jira/browse/ARROW-5864)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.