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
f9a5a864
Commit
f9a5a864
authored
Aug 21, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
e3282b00
c4c0acc5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+1
-1
tests/run/cpp_classes.pyx
tests/run/cpp_classes.pyx
+6
-6
tests/run/staticmethod.pyx
tests/run/staticmethod.pyx
+9
-0
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
f9a5a864
...
...
@@ -2555,7 +2555,7 @@ class TransformBuiltinMethods(EnvTransform):
node
=
ExprNodes
.
StringNode
(
node
.
pos
,
value
=
EncodedString
(
version
))
elif
attribute
==
u'NULL'
:
node
=
ExprNodes
.
NullNode
(
node
.
pos
)
elif
attribute
in
(
u'set'
,
u'frozenset'
):
elif
attribute
in
(
u'set'
,
u'frozenset'
,
u'staticmethod'
):
node
=
ExprNodes
.
NameNode
(
node
.
pos
,
name
=
EncodedString
(
attribute
),
entry
=
self
.
current_env
().
builtin_scope
().
lookup_here
(
attribute
))
elif
PyrexTypes
.
parse_basic_type
(
attribute
):
...
...
tests/run/cpp_classes.pyx
View file @
f9a5a864
...
...
@@ -9,19 +9,19 @@ cdef extern from "shapes.h" namespace "shapes":
cdef
cppclass
Circle
(
Shape
):
int
radius
Circle
(
int
)
except
+
Circle
(
int
r
)
except
+
cdef
cppclass
Rectangle
(
Shape
):
int
width
int
height
Rectangle
()
except
+
Rectangle
(
int
,
int
)
except
+
int
method
(
int
)
int
method
(
bint
)
Rectangle
(
int
h
,
int
w
)
except
+
int
method
(
int
x
)
int
method
(
bint
b
)
cdef
cppclass
Square
(
Rectangle
):
int
side
Square
(
int
)
except
+
Square
(
int
s
)
except
+
cdef
cppclass
Empty
(
Shape
):
pass
...
...
tests/run/staticmethod.pyx
View file @
f9a5a864
...
...
@@ -120,3 +120,12 @@ cdef class ArgsKwargs(object):
(1, 2, ('a', 3))
"""
return
args
+
tuple
(
sorted
(
kwargs
.
items
()))
class
StaticmethodSubclass
(
staticmethod
):
"""
>>> s = StaticmethodSubclass(None)
>>> s.is_subtype()
True
"""
def
is_subtype
(
self
):
return
isinstance
(
self
,
staticmethod
)
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