8000 [CLN] More Misc Cleanups in _libs by jbrockmendel · Pull Request #22287 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

[CLN] More Misc Cleanups in _libs #22287

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

Merged
merged 9 commits into from
Aug 20, 2018
Prev Previous commit
Next Next commit
revert to troubleshoot travis
  • Loading branch information
jbrockmendel committed Aug 15, 2018
commit c09f234f58438ab5d9cadb9a1d27bc84215de3f4
7 changes: 4 additions & 3 deletions pandas/_libs/internals.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
cimport cython
from cython cimport Py_ssize_t

from cpython cimport PyObject
from cpython.slice cimport PySlice_Check

cdef extern from "Python.h":
Expand All @@ -12,7 +13,7 @@ import numpy as np
from numpy cimport int64_t

cdef extern from "compat_helper.h":
cdef int slice_get_indices(object s, Py_ssize_t length,
cdef int slice_get_indices(PyObject* s, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop,
Py_ssize_t *step,
Py_ssize_t *slicelength) except -1
Expand Down Expand Up @@ -248,7 +249,7 @@ cpdef Py_ssize_t slice_len(
if slc is None:
raise TypeError("slc must be slice")

slice_get_indices(<object>slc, objlen,
slice_get_indices(<PyObject *>slc, objlen,
&start, &stop, &step, &length)

return length
Expand All @@ -268,7 +269,7 @@ cpdef slice_get_indices_ex(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX):
if slc is None:
raise TypeError("slc should be a slice")

slice_get_indices(<object>slc, objlen,
slice_get_indices(<PyObject *>slc, objlen,
&start, &stop, &step, &length)

return start, stop, step, length
Expand Down
0