Last active
January 23, 2020 20:32
-
-
Save edenau/a56148f29f30dc48f9f74aa8f6128823 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_func(a, b, /, c, d, *, e, f): | |
return a+b+c+d+e+f | |
my_func(1,2,3,4,5,6) # invalid as e and f are keyword-only | |
my_func(a=1,b=2,3,4,e=5,f=6) # invalid as a and b are position-only | |
my_func(1,2,3,d=4,e=5,f=6) # returns 21 | |
my_func(1,2,c=3,d=4,e=5,f=6) # returns 21 |
In python 3.8.1 the line 6 returns
SyntaxError: positional argument follows keyword argument
The line 7 says
my_unc
Thanks for the article
Fixed. Cheers!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In python 3.8.1 the line 6 returns
SyntaxError: positional argument follows keyword argument
The line 7 says
my_unc
Thanks for the article