New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language Reference - optional comma #67131
Comments
# I would like to report three bugs in the ################################# # In 8.6 the rule for parameter_list should be corrected: The first "|" should be "(" # parameter_list ::= (defparameter ",")* # This rule was correct in 3.3 but has been changed with issue bpo-21439, I guess. ############################################################################### # In 6.3.4: # Why is this wrong?
print(1,2,) # is allowed
print(*(1,2)) # is allowed
#print(*(1,2),) # is allowed according to the syntax - but not accepted # I guess the trailing comma is only allowed when there is no *-argument ########################################################### # In 8.6: # Why is this wrong?
def klammer(klammer_left,klammer_right):
def klammer_decorator(func):
def func_wrapper(name):
return klammer_left + func(name) + klammer_right
return func_wrapper
return klammer_decorator @Klammer("<",">",) # is allowed @Klammer(("<",">")) # is allowed # I guess the decorator rule might be changed to: |
See also bpo-9232, about adding support for trailing commas in all cases of function calls and definitions. |
Bug 1 is still present in 3.5. In 3.6 it is no longer relevant because the documentation was changed for bpo-9232 (allowing trailing commas in function definitions). Bug 2 is present in 2.7, but is not relevant to 3.5+. Trailing commas are now allowed in function calls, probably thanks to PEP-448, unpacking generalizations. Bug 3 has been fixed in bpo-27042. |
bpo-28978 covers the parameter list syntax (Bug 1 + plus another problem). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: