Commit f9a5a864 authored by Stefan Behnel's avatar Stefan Behnel

merge

parents e3282b00 c4c0acc5
...@@ -2555,7 +2555,7 @@ class TransformBuiltinMethods(EnvTransform): ...@@ -2555,7 +2555,7 @@ class TransformBuiltinMethods(EnvTransform):
node = ExprNodes.StringNode(node.pos, value=EncodedString(version)) node = ExprNodes.StringNode(node.pos, value=EncodedString(version))
elif attribute == u'NULL': elif attribute == u'NULL':
node = ExprNodes.NullNode(node.pos) 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), node = ExprNodes.NameNode(node.pos, name=EncodedString(attribute),
entry=self.current_env().builtin_scope().lookup_here(attribute)) entry=self.current_env().builtin_scope().lookup_here(attribute))
elif PyrexTypes.parse_basic_type(attribute): elif PyrexTypes.parse_basic_type(attribute):
......
...@@ -9,19 +9,19 @@ cdef extern from "shapes.h" namespace "shapes": ...@@ -9,19 +9,19 @@ cdef extern from "shapes.h" namespace "shapes":
cdef cppclass Circle(Shape): cdef cppclass Circle(Shape):
int radius int radius
Circle(int) except + Circle(int r) except +
cdef cppclass Rectangle(Shape): cdef cppclass Rectangle(Shape):
int width int width
int height int height
Rectangle() except + Rectangle() except +
Rectangle(int, int) except + Rectangle(int h, int w) except +
int method(int) int method(int x)
int method(bint) int method(bint b)
cdef cppclass Square(Rectangle): cdef cppclass Square(Rectangle):
int side int side
Square(int) except + Square(int s) except +
cdef cppclass Empty(Shape): cdef cppclass Empty(Shape):
pass pass
......
...@@ -120,3 +120,12 @@ cdef class ArgsKwargs(object): ...@@ -120,3 +120,12 @@ cdef class ArgsKwargs(object):
(1, 2, ('a', 3)) (1, 2, ('a', 3))
""" """
return args + tuple(sorted(kwargs.items())) return args + tuple(sorted(kwargs.items()))
class StaticmethodSubclass(staticmethod):
"""
>>> s = StaticmethodSubclass(None)
>>> s.is_subtype()
True
"""
def is_subtype(self):
return isinstance(self, staticmethod)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment