Commit f9a5a864 authored by Stefan Behnel's avatar Stefan Behnel

merge

parents e3282b00 c4c0acc5
......@@ -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):
......
......@@ -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
......@@ -154,7 +154,7 @@ def test_template_class_member():
inner.push_back(Empty())
o = TemplateClassMember()
o.vec.push_back(inner)
start_destructor_count = destructor_count
del o
assert destructor_count - start_destructor_count == 2, \
......
......@@ -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)
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