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

2018-04-24 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> not a bug ___ Python tracker ___

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

2018-04-24 Thread Kasra Vand
Change by Kasra Vand : -- stage: -> resolved status: open -> closed ___ Python tracker ___

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

2018-04-24 Thread Kasra Vand
Kasra Vand 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

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

2018-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And consider the example `3 + not 4 + 5`. -- ___ Python tracker ___

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

2018-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If `3 + not 4` be accepted, should it be evaluated to the same value as `not 4 + 3`? Currently the result of `not 4 + 3` is False. -- ___ Python tracker

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

2018-04-24 Thread Kasra Vand
Kasra Vand 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

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

2018-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You can use 3 + (not 4). -- nosy: +serhiy.storchaka ___ Python tracker ___

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

2018-04-24 Thread Kasra Vand
Kasra Vand 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

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

2018-04-24 Thread Kasra Vand
New submission from Kasra Vand : 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`