1. Joe Amenta
  2. lib3to2

Commits

Joe Amenta  committed 29b9456

Using a synthetic name for keyword arguments instead of just "kwargs", when we have to come up with one.

  • Participants
  • Parent commits 4f144e9
  • Branches default

Comments (0)

Files changed (1)

File lib3to2/tests/test_kwargs.py

View file
  • Ignore whitespace
         def spam(ham, *, eggs, monkeys):
             funky()"""
         a = """
-        def spam(ham, **kwargs):
-            eggs = kwargs['eggs']
-            monkeys = kwargs['monkeys']            
+        def spam(ham, **_3to2kwargs):
+            eggs = _3to2kwargs['eggs']
+            monkeys = _3to2kwargs['monkeys']            
             funky()"""
         self.check(b, a)
 
         def spam(ham, *, dinosaurs, eggs=3, monkeys=2):
             funky()"""
         a = """
-        def spam(ham, **kwargs):
-            dinosaurs = kwargs['dinosaurs']
-            if 'eggs' in kwargs:
-                eggs = kwargs['eggs']
+        def spam(ham, **_3to2kwargs):
+            dinosaurs = _3to2kwargs['dinosaurs']
+            if 'eggs' in _3to2kwargs:
+                eggs = _3to2kwargs['eggs']
             else:
                 eggs = 3
-            if 'monkeys' in kwargs:
-                monkeys = kwargs['monkeys']
+            if 'monkeys' in _3to2kwargs:
+                monkeys = _3to2kwargs['monkeys']
             else:
                 monkeys = 2
             funky()"""