[issue22942] Language Reference - optional comma

2021-11-30 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22942] Language Reference - optional comma

2016-12-24 Thread Martin Panter

Martin Panter added the comment:

Issue 28978 covers the parameter list syntax (Bug 1 + plus another problem).

--
dependencies: +a redundant right  parentheses in the EBNF rules of 
parameter_list

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22942] Language Reference - optional comma

2016-06-08 Thread Martin Panter

Martin Panter added the comment:

Bug 1 is still present in 3.5. In 3.6 it is no longer relevant because the 
documentation was changed for Issue 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 Issue 27042.

--
stage:  -> needs patch
versions: +Python 2.7, Python 3.5 -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22942] Language Reference - optional comma

2015-03-23 Thread Martin Panter

Martin Panter added the comment:

See also Issue 9232, about adding support for trailing commas in all cases of 
function calls and definitions.

--
nosy: +vadmium

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22942
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22942] Language Reference - optional comma

2015-03-02 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +Joshua.Landau, neil.g

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22942
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22942] Language Reference - optional comma

2014-11-25 Thread Jordan

New submission from Jordan:

# I would like to report three bugs in the
# Language Reference Python 3.4.2

#
# bug 1: Typo in parameter_list #
#

# In 8.6 the rule for parameter_list should be corrected: The first | should 
be (

# parameter_list ::=  (defparameter ,)*
# | * [parameter] (, defparameter)* [, ** parameter]
# | ** parameter
# | defparameter [,] )

# This rule was correct in 3.3 but has been changed with issue #21439, I guess.


###
# bug 2: print(*(1,2),) is allowed according to the syntax - but not accepted #
###

# In 6.3.4:
# call ::=  primary ( [argument_list [,] | comprehension] 
)
# argument_list::=  positional_arguments [, keyword_arguments]
# [, * expression] [, keyword_arguments]
# [, ** expression]
#   | keyword_arguments [, * expression]
# [, keyword_arguments] [, ** expression]
#   | * expression [, keyword_arguments] [, ** 
expression]
#   | ** expression

# 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
# as it is in the rule for parameter_list

###
# bug 3: decorator rule allows (aditional) trailing comma #
###

# In 8.6:
# decorator  ::=  @ dotted_name [( [parameter_list [,]] )] NEWLINE
# parameter_list ::=  (defparameter ,)*
# ( * [parameter] (, defparameter)* [, ** parameter]
# | ** parameter
# | defparameter [,] )

# 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 according to the syntax - but is not accepted
def get_text(name):
return Hallo  + name
print(get_text(Uli)) 

@klammer(*(,))   # is allowed
#@klammer(*(,),) # is allowed according to the syntax - but is not 
accepted
def get_text(name):
return Hallo  + name
print(get_text(Uli))

# I guess the decorator rule might be changed to: 
# decorator  ::=  @ dotted_name [( [parameter_list  ] )] NEWLINE
# The other appearences of parameter_list have no optional comma.

--
assignee: docs@python
components: Documentation
messages: 231680
nosy: docs@python, jordan
priority: normal
severity: normal
status: open
title: Language Reference - optional comma
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22942
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22942] Language Reference - optional comma

2014-11-25 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22942
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com