Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
cython
Commits
ac886ee9
Commit
ac886ee9
authored
Sep 30, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make cypclass isinstanceof work for const arguments
parent
fe8b742b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
2 deletions
+3
-2
Cython/Compiler/Builtin.py
Cython/Compiler/Builtin.py
+1
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+1
-0
Cython/Utility/CyObjects.cpp
Cython/Utility/CyObjects.cpp
+1
-1
No files found.
Cython/Compiler/Builtin.py
View file @
ac886ee9
...
...
@@ -675,7 +675,7 @@ def inject_cypclass_typecheck_functions():
isinstanceof_type
=
PyrexTypes
.
CFuncType
(
PyrexTypes
.
c_int_type
,
[
PyrexTypes
.
CFuncTypeArg
(
"obj"
,
PyrexTypes
.
cy_object_type
,
None
),
PyrexTypes
.
CFuncTypeArg
(
"obj"
,
PyrexTypes
.
c
onst_c
y_object_type
,
None
),
PyrexTypes
.
CFuncTypeArg
(
"type"
,
template_placeholder_type
,
None
)
],
nogil
=
1
,
...
...
Cython/Compiler/PyrexTypes.py
View file @
ac886ee9
...
...
@@ -5040,6 +5040,7 @@ unspecified_type = UnspecifiedType()
py_object_type
=
PyObjectType
()
cy_object_type
=
CypClassType
(
'cyobject'
,
None
,
"CyObject"
,
None
)
const_cy_object_type
=
ConstCypclassType
(
cy_object_type
)
c_void_type
=
CVoidType
()
...
...
Cython/Utility/CyObjects.cpp
View file @
ac886ee9
...
...
@@ -456,7 +456,7 @@
template
<
typename
T
,
typename
O
>
static
inline
int
isinstanceof
(
O
ob
)
{
static_assert
(
std
::
is_convertible
<
T
,
CyObject
*>::
value
,
"wrong type 'T' for isinstanceof[T]"
);
return
dynamic_cast
<
T
>
(
ob
)
!=
NULL
;
return
dynamic_cast
<
const
typename
std
::
remove_pointer
<
T
>::
type
*
>
(
ob
)
!=
NULL
;
}
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment