From 1cf58c31cceb26f11b8fcfcfd188fd817ce95a94 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 19 Aug 2017 00:22:14 +0200 Subject: [PATCH] remove the parens on the cmp lambda definition See #297 Before this change, the code in question generates a SyntaxError in Python 3 --- docs/compatible_idioms.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/compatible_idioms.rst b/docs/compatible_idioms.rst index e48ac6d1..7eb0cfb6 100644 --- a/docs/compatible_idioms.rst +++ b/docs/compatible_idioms.rst @@ -1120,7 +1120,7 @@ cmp() .. code:: python # Python 2 and 3: alternative 2 - cmp = lambda(x, y): (x > y) - (x < y) + cmp = lambda x, y: (x > y) - (x < y) assert cmp('a', 'b') < 0 and cmp('b', 'a') > 0 and cmp('c', 'c') == 0 reload() ~~~~~~~~