Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8132683

Browse filesBrowse files
authored
MAINT Directly cimport stack from Cython (#29228)
Signed-off-by: Adam Li <adam2392@gmail.com>
1 parent 8a5d8c3 commit 8132683
Copy full SHA for 8132683

File tree

Expand file treeCollapse file tree

1 file changed

+1
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-9
lines changed

‎sklearn/tree/_tree.pyx

Copy file name to clipboardExpand all lines: sklearn/tree/_tree.pyx
+1-9Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ from libc.math cimport isnan
2222
from libcpp.vector cimport vector
2323
from libcpp.algorithm cimport pop_heap
2424
from libcpp.algorithm cimport push_heap
25+
from libcpp.stack cimport stack
2526
from libcpp cimport bool
2627

2728
import struct
@@ -43,15 +44,6 @@ cdef extern from "numpy/arrayobject.h":
4344
void* data, int flags, object obj)
4445
int PyArray_SetBaseObject(cnp.ndarray arr, PyObject* obj)
4546

46-
cdef extern from "<stack>" namespace "std" nogil:
47-
cdef cppclass stack[T]:
48-
ctypedef T value_type
49-
stack() except +
50-
bint empty()
51-
void pop()
52-
void push(T&) except + # Raise c++ exception for bad_alloc -> MemoryError
53-
T& top()
54-
5547
# =============================================================================
5648
# Types and constants
5749
# =============================================================================

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.