Sfoglia il codice sorgente

remove the parens from the cmp() lambda definition (#3526)

* remove the parens from the cmp() lambda definition

https://github.com/PythonCharmers/python-future/pull/298

* remove the parens from the cmp() lambda definition

https://github.com/PythonCharmers/python-future/pull/298
cclauss 8 anni fa
parent
commit
472f700884

+ 2 - 2
python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py

@@ -56,9 +56,9 @@ from google.protobuf.internal import test_util
 from google.protobuf import message
 
 try:
-  cmp                                    # Python 2
+  cmp                                   # Python 2
 except NameError:
-  cmp = lambda(x, y): (x > y) - (x < y)  # Python 3
+  cmp = lambda x, y: (x > y) - (x < y)  # Python 3
 
 # Python pre-2.6 does not have isinf() or isnan() functions, so we have
 # to provide our own.

+ 2 - 2
python/google/protobuf/internal/message_test.py

@@ -57,9 +57,9 @@ try:
 except ImportError:
   import unittest
 try:
-  cmp                                    # Python 2
+  cmp                                   # Python 2
 except NameError:
-  cmp = lambda(x, y): (x > y) - (x < y)  # Python 3
+  cmp = lambda x, y: (x > y) - (x < y)  # Python 3
 
 from google.protobuf import map_unittest_pb2
 from google.protobuf import unittest_pb2