From: Stefan Behnel Date: Fri, 8 Feb 2008 12:26:34 +0000 (+0100) Subject: test for some problematic **kw use cases X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=04794cd725307db04e270c85f610f1a6ce6f9733;p=cython.git test for some problematic **kw use cases --- diff --git a/tests/run/kwargproblems.pyx b/tests/run/kwargproblems.pyx new file mode 100644 index 00000000..1632eb9d --- /dev/null +++ b/tests/run/kwargproblems.pyx @@ -0,0 +1,24 @@ +__doc__ = """ + >>> d = {1 : 2} + >>> test(**d) + Traceback (most recent call last): + TypeError: test() keywords must be strings + >>> d + {1: 2} + + >>> d = {} + >>> test(**d) + {'arg': 3} + >>> d + {} + + >>> d = {'arg' : 2} + >>> test(**d) + {'arg': 3} + >>> d + {'arg': 2} +""" + +def test(**kw): + kw['arg'] = 3 + return kw