[issue36765] Invalid grammar for f_expression

2019-05-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, Serhiy.

I suppose that we could add a note to the documentation, but I'm not sure it 
would be worth the confusion it would create. It's best to think of this is 
"it's just an expression,  like everywhere else in Python". If I ever decide I 
like PEP 536, maybe then things will become clearer (although possibly not: the 
same issue will still exist, but I think it will become more obvious that 
expressions are treated just like they are elsewhere).

So I'm going to close this.

--
resolution:  -> not a bug
stage:  -> 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



[issue36765] Invalid grammar for f_expression

2019-05-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Concur with Eric. The formal definition of the Python grammar is wider than 
valid Python, because we do not want to make it too complex. Invalid 
constructions are filtered out later.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36765] Invalid grammar for f_expression

2019-05-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't think this is a problem. There are plenty of things allowed by Python's 
grammar that are converted to errors in subsequent passes. For example:

>>> *[1]
  File "", line 1
SyntaxError: can't use starred expression here
>>> *[1],*[2]
(1, 2)

--

___
Python tracker 

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



[issue36765] Invalid grammar for f_expression

2019-05-01 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eric.smith

___
Python tracker 

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



[issue36765] Invalid grammar for f_expression

2019-05-01 Thread Kasra Vand


Kasra Vand  added the comment:

Due to the discussion in following SO question 
https://stackoverflow.com/questions/55933956/what-does-a-star-asterisk-do-in-f-string/55934472#55933956

and the inconsistency of the source behaviour with the documentation I think 
using `"*" or_expr` for f_expression is wrong or at least not what it meant to 
be and very vague. I was wondering if there's any reason for using `"*" 
or_expr` instead of let's say just `expr` which I think is what the `or_expr` 
identifier is intended to be.

--

___
Python tracker 

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



[issue36765] Invalid grammar for f_expression

2019-05-01 Thread Kasra Vand


New submission from Kasra Vand :

Due to the discussion in following SO question 
https://stackoverflow.com/questions/55933956/what-does-a-star-asterisk-do-in-f-string/55934472#55933956

and the inconsistency of the source behaviour with the documentation I think 
using `"*" or_expr` for f_expression is wrong or at least not what it meant to 
be and very vague. I was wondering if there's any reason for using `"*" 
or_expr`.

--
assignee: docs@python
components: Documentation
messages: 341186
nosy: Kasra Vand, docs@python
priority: normal
severity: normal
status: open
title: Invalid grammar for f_expression
type: behavior
versions: Python 3.7

___
Python tracker 

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