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
Gwenaël Samain
cython
Commits
1833eba8
Commit
1833eba8
authored
Oct 29, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up code in PythranExpr class.
parent
3a57260e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+8
-14
No files found.
Cython/Compiler/PyrexTypes.py
View file @
1833eba8
...
...
@@ -1488,35 +1488,29 @@ class PythranExpr(CType):
self
.
from_py_function
=
"from_python<%s>"
%
(
self
.
pythran_type
)
self
.
scope
=
None
def
declaration_code
(
self
,
entity_code
,
for_display
=
0
,
dll_linkage
=
None
,
pyrex
=
0
):
assert
pyrex
==
0
return
"%s %s"
%
(
self
.
name
,
entity_code
)
def
declaration_code
(
self
,
entity_code
,
for_display
=
0
,
dll_linkage
=
None
,
pyrex
=
0
):
assert
not
pyrex
return
"%s %s"
%
(
self
.
c
name
,
entity_code
)
def
attributes_known
(
self
):
if
self
.
scope
is
None
:
from
.
import
Symtab
self
.
scope
=
scope
=
Symtab
.
CClassScope
(
''
,
None
,
visibility
=
"extern"
)
# FIXME: fake C scope, might be better represented by a struct or C++ class scope
self
.
scope
=
scope
=
Symtab
.
CClassScope
(
''
,
None
,
visibility
=
"extern"
)
scope
.
parent_type
=
self
scope
.
directives
=
{}
# rank 3 == long
scope
.
declare_var
(
"shape"
,
CPtrType
(
CIntType
(
3
)),
None
,
cname
=
"_shape"
,
is_cdef
=
True
)
scope
.
declare_var
(
"ndim"
,
CIntType
(
3
),
None
,
cname
=
"value"
,
is_cdef
=
True
)
scope
.
declare_var
(
"shape"
,
CPtrType
(
c_long_type
),
None
,
cname
=
"_shape"
,
is_cdef
=
True
)
scope
.
declare_var
(
"ndim"
,
c_long_type
,
None
,
cname
=
"value"
,
is_cdef
=
True
)
return
True
def
__eq__
(
self
,
other
):
"""Equality operation for PythranExpr using the str representation"""
return
isinstance
(
other
,
PythranExpr
)
and
self
.
pythran_type
==
other
.
pythran_type
def
__ne__
(
self
,
other
):
"""Equality operation for PythranExpr using the str representation"""
return
not
isinstance
(
other
,
PythranExpr
)
or
self
.
pythran_type
!=
other
.
pythran_type
return
not
(
isinstance
(
other
,
PythranExpr
)
and
self
.
pythran_type
==
other
.
pythran_type
)
def
__hash__
(
self
):
"""Hash function using the str representation"""
return
hash
(
self
.
pythran_type
)
...
...
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