Commit 480798a6 authored by Vitja Makarov's avatar Vitja Makarov

Add generic python args test

parent f871cad3
......@@ -35,6 +35,9 @@ def unused_and_unassigned():
cdef object foo
cdef int i
def unused_generic(*args, **kwargs):
pass
_ERRORS = """
6:6: Unused entry 'a'
9:9: Unused entry 'b'
......@@ -44,4 +47,6 @@ _ERRORS = """
25:4: Unused entry 'Unused'
35:16: Unused entry 'foo'
36:13: Unused entry 'i'
38:20: Unused argument 'args'
38:28: Unused argument 'kwargs'
"""
cdef c_unused_simple(a, b, c):
"""
>>> c_unused_simple(1, 2, 3)
3
"""
return a + b
cdef c_unused_optional(a, b, c=1, d=2):
"""
>>> c_unused_optional(1, 2)
4
>>> c_unused_optional(1, 2, 3, 4)
6
"""
return b + d
cpdef cp_unused_simple(a, b, c):
"""
>>> cp_unused_simple(1, 2, 3)
3
"""
return a + b
cpdef cp_unused_optional(a, b, c=1, d=2):
"""
>>> cp_unused_optional(1, 2)
4
>>> cp_unused_optional(1, 2, 3, 4)
6
"""
return b + d
cdef class Unused:
"""
>>> o = Unused()
"""
cpdef cp_unused_simple(self, a, b, c):
return c
cpdef cp_unused_optional(self, a, b, c=1, d=2):
return b + d
def def_unused(a, b, c):
"""
>>> def_unused(1, 2, 3)
"""
def def_unused_metho(o):
"""
>>> def_unused_metho(0)
"""
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