Skip to content

[Python] Remove / Update code that might not be required with Cython > 2 #45253

Closed

Description

@raulcd

Describe the enhancement requested

When bumping Cython to >= 3, on:

We noticed there's a couple of places where there are comments related to some code required in order to make it compatible with both Cython 2 and 3:
#45238 (comment)

This can possibly be removed or simplified.

Basically:

cdef extern from "arrow/python/common.h" namespace "arrow::py" nogil:
cdef cppclass SharedPtrNoGIL[T](shared_ptr[T]):
# This looks like the only way to satisfy both Cython 2 and Cython 3
SharedPtrNoGIL& operator=(...)
cdef cppclass UniquePtrNoGIL[T, DELETER=*](unique_ptr[T, DELETER]):
UniquePtrNoGIL& operator=(...)

and

# Will be available in Cython 3, not backported
# ref: https://github.com/cython/cython/issues/3293#issuecomment-1223058101
cdef extern from "<optional>" namespace "std" nogil:
cdef cppclass nullopt_t:
nullopt_t()
cdef nullopt_t nullopt

This is not strictly required for bumping the required version so it can be tackled as a separate issue.

Component(s)

Python

Activity

  1. raulcd commented on Feb 7, 2025

    @raulcd
    MemberAuthor

    @pitrou this was covered by:

    can be closed right?

  2. pitrou commented on Feb 7, 2025

    @pitrou
    Member

    Oh, yes. We have so many issues open that it's difficult to find existing ones before opening a new one :(

  3. pitrou commented on Feb 7, 2025

    @pitrou
    Member

    Done in #45433

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

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