[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 
<https://bugs.python.org/issue36765>
___
___
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 
<https://bugs.python.org/issue36765>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Kasra Vand

Change by Kasra Vand <kasraav...@gmail.com>:


--
stage:  -> resolved
status: open -> closed

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



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Kasra Vand

Kasra Vand <kasraav...@gmail.com> added the comment:

I think this will contradict to Python's operators precedence. What I mentioned 
seems like you're passing the number as an argument to `not`, and this is while 
`not` is not a function. There is an `operator.not_` function that does the 
same job as expected though.

Now I see why it's not efficient and wise to do so. This is violation of  
operators precedence.

--

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



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Kasra Vand

Kasra Vand <kasraav...@gmail.com> added the comment:

Thanks, Indeed. But my question is more about the syntax and why it's not that 
straight? The reasons for that is because Python is known as a scientific 
programming language and many people come with mathematical background and may 
want to use this kind of syntax.

So is it possible to add this feature?

--

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



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Kasra Vand

Kasra Vand <kasraav...@gmail.com> added the comment:

This may seem not very useful while except 0 for other numbers it returns False 
but one may want to use another proposition inside `not` that can use either 0 
or a nonzero number. Also, in this case we can form more comprehensive logical 
propositions.

--

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



[issue33344] Use logical negation of integers directly in arithmatic propostions and equations

2018-04-24 Thread Kasra Vand

New submission from Kasra Vand <kasraav...@gmail.com>:

Logical Negation of integers in Python always returns a Boolean result which 
can be achieve using `not`. Sometimes it's necessary to use this result 
directly in a proposition within a list comprehension (mostly). But if we use 
`not` directly in such arithmatic proposition it will raise a `SyntaxError.

```
In [46]: 3 + not(4)
  File "", line 1
3 + not(4)
  ^
SyntaxError: invalid syntax

```

Isn't that possible to make this work for integers in future releases? I was 
more curious to know what would be the drawbacks of such feature if there are 
any?

--
components: Interpreter Core
messages: 315688
nosy: Kasra Vand
priority: normal
severity: normal
status: open
title: Use logical negation of integers directly in arithmatic propostions and 
equations
type: behavior
versions: Python 3.7

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