diff options
Diffstat (limited to 'tests/errors/e_argdefault.pyx')
-rw-r--r-- | tests/errors/e_argdefault.pyx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/errors/e_argdefault.pyx b/tests/errors/e_argdefault.pyx index d8828741f..afcf0e325 100644 --- a/tests/errors/e_argdefault.pyx +++ b/tests/errors/e_argdefault.pyx @@ -1,19 +1,27 @@ # mode: error cdef spam(int i, char *s = "blarg", float f): # can't have default value - pass + pass def swallow(x, y = 42, z): # non-default after default - pass + pass cdef class Grail: - def __add__(x, y = 42): # can't have default value - pass + def __add__(x, y = 42): # can't have default value + pass + + def __pow__(x, y, z=10): # default must be None + pass + + def __rpow__(x, y=2, z=None): # z is OK, y isn't + pass _ERRORS = u""" -3:10: Non-default argument follows default argument +3:9: Non-default argument follows default argument 3:36: Non-default argument following default argument 6:23: Non-default argument following default argument -11:16: This argument cannot have a default value +11:19: This argument cannot have a default value +14:22: This argument cannot have a non-None default value +17:20: This argument cannot have a default value """ |