From 04794cd725307db04e270c85f610f1a6ce6f9733 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 8 Feb 2008 13:26:34 +0100 Subject: [PATCH] test for some problematic **kw use cases --- tests/run/kwargproblems.pyx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/run/kwargproblems.pyx 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 -- 2.26.2