Commit 47850c40 authored by Stefan Behnel's avatar Stefan Behnel

Fix and enforce a couple of code formatting issues. (II)

parent df568482
...@@ -321,11 +321,11 @@ def test_closures1(x,y): ...@@ -321,11 +321,11 @@ def test_closures1(x,y):
Traceback (most recent call last): Traceback (most recent call last):
TypeError: ...g() ... positional argument... TypeError: ...g() ... positional argument...
""" """
def g(x2,/,y2): def g(x2, /, y2):
return x + y + x2 + y2 return x + y + x2 + y2
return g return g
def test_closures2(x,/,y): def test_closures2(x, /, y):
""" """
>>> test_closures2(1,2)(3,4) >>> test_closures2(1,2)(3,4)
10 10
...@@ -335,7 +335,7 @@ def test_closures2(x,/,y): ...@@ -335,7 +335,7 @@ def test_closures2(x,/,y):
return g return g
def test_closures3(x,/,y): def test_closures3(x, /, y):
""" """
>>> test_closures3(1,2)(3,4) >>> test_closures3(1,2)(3,4)
10 10
...@@ -346,7 +346,7 @@ def test_closures3(x,/,y): ...@@ -346,7 +346,7 @@ def test_closures3(x,/,y):
Traceback (most recent call last): Traceback (most recent call last):
TypeError: ...g() ... positional argument... TypeError: ...g() ... positional argument...
""" """
def g(x2,/,y2): def g(x2, /, y2):
return x + y + x2 + y2 return x + y + x2 + y2
return g return g
...@@ -453,21 +453,21 @@ def f_call_1_0_0(a,/): ...@@ -453,21 +453,21 @@ def f_call_1_0_0(a,/):
""" """
return (a,) return (a,)
def f_call_1_1_0(a,/,b): def f_call_1_1_0(a, /, b):
""" """
>>> f_call_1_1_0(1,2) >>> f_call_1_1_0(1,2)
(1, 2) (1, 2)
""" """
return (a,b) return (a,b)
def f_call_1_1_1(a,/,b,*,c): def f_call_1_1_1(a, /, b, *, c):
""" """
>>> f_call_1_1_1(1,2,c=3) >>> f_call_1_1_1(1,2,c=3)
(1, 2, 3) (1, 2, 3)
""" """
return (a,b,c) return (a,b,c)
def f_call_1_1_1_star(a,/,b,*args,c): def f_call_1_1_1_star(a, /, b, *args, c):
""" """
>>> f_call_1_1_1_star(1,2,c=3) >>> f_call_1_1_1_star(1,2,c=3)
(1, 2, (), 3) (1, 2, (), 3)
...@@ -476,7 +476,7 @@ def f_call_1_1_1_star(a,/,b,*args,c): ...@@ -476,7 +476,7 @@ def f_call_1_1_1_star(a,/,b,*args,c):
""" """
return (a,b,args,c) return (a,b,args,c)
def f_call_1_1_1_kwds(a,/,b,*,c,**kwds): def f_call_1_1_1_kwds(a, /, b, *, c, **kwds):
""" """
>>> f_call_1_1_1_kwds(1,2,c=3) >>> f_call_1_1_1_kwds(1,2,c=3)
(1, 2, 3, {}) (1, 2, 3, {})
...@@ -485,7 +485,7 @@ def f_call_1_1_1_kwds(a,/,b,*,c,**kwds): ...@@ -485,7 +485,7 @@ def f_call_1_1_1_kwds(a,/,b,*,c,**kwds):
""" """
return (a,b,c,kwds) return (a,b,c,kwds)
def f_call_1_1_1_star_kwds(a,/,b,*args,c,**kwds): def f_call_1_1_1_star_kwds(a, /, b, *args, c, **kwds):
""" """
>>> f_call_1_1_1_star_kwds(1,2,c=3,d=4,e=5) == (1, 2, (), 3, {'d': 4, 'e': 5}) >>> f_call_1_1_1_star_kwds(1,2,c=3,d=4,e=5) == (1, 2, (), 3, {'d': 4, 'e': 5})
True True
...@@ -494,7 +494,7 @@ def f_call_1_1_1_star_kwds(a,/,b,*args,c,**kwds): ...@@ -494,7 +494,7 @@ def f_call_1_1_1_star_kwds(a,/,b,*args,c,**kwds):
""" """
return (a,b,args,c,kwds) return (a,b,args,c,kwds)
def f_call_one_optional_kwd(a,/,*,b=2): def f_call_one_optional_kwd(a, /, *, b=2):
""" """
>>> f_call_one_optional_kwd(1) >>> f_call_one_optional_kwd(1)
(1, 2) (1, 2)
...@@ -503,7 +503,7 @@ def f_call_one_optional_kwd(a,/,*,b=2): ...@@ -503,7 +503,7 @@ def f_call_one_optional_kwd(a,/,*,b=2):
""" """
return (a,b) return (a,b)
def f_call_posonly_stararg(a,/,*args): def f_call_posonly_stararg(a, /, *args):
""" """
>>> f_call_posonly_stararg(1) >>> f_call_posonly_stararg(1)
(1, ()) (1, ())
...@@ -512,7 +512,7 @@ def f_call_posonly_stararg(a,/,*args): ...@@ -512,7 +512,7 @@ def f_call_posonly_stararg(a,/,*args):
""" """
return (a,args) return (a,args)
def f_call_posonly_kwarg(a,/,**kw): def f_call_posonly_kwarg(a, /, **kw):
""" """
>>> f_call_posonly_kwarg(1) >>> f_call_posonly_kwarg(1)
(1, {}) (1, {})
...@@ -522,7 +522,7 @@ def f_call_posonly_kwarg(a,/,**kw): ...@@ -522,7 +522,7 @@ def f_call_posonly_kwarg(a,/,**kw):
""" """
return (a,kw) return (a,kw)
def f_call_posonly_stararg_kwarg(a,/,*args,**kw): def f_call_posonly_stararg_kwarg(a, /, *args, **kw):
""" """
>>> f_call_posonly_stararg_kwarg(1) >>> f_call_posonly_stararg_kwarg(1)
(1, (), {}) (1, (), {})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment