[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-12 Thread Evgeniy Ivanov


New submission from Evgeniy Ivanov :

Why operator 'pass' not implement to 'if-else' linear expression?
Construction ' if  else pass' throws SyntaxError in 
Python 3.9

--
messages: 403793
nosy: evgnor86
priority: normal
severity: normal
status: open
title: operator 'pass' in 'if-else' linear expression
type: compile error
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

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



[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-12 Thread Evgeniy Ivanov


Change by Evgeniy Ivanov :


--
resolution: not a bug -> 
status: closed -> open
type: compile error -> 

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



[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-12 Thread Evgeniy Ivanov


Evgeniy Ivanov  added the comment:

ok, but what you say for this?

x += x*2 if math.pow(x) > 386 else pass

and 

if math.pow(x) > 386:
 x += x*2

1 line vs 2 line

now i'm use this

x += x*2 if math.pow(x) > 386 else ''

--

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



[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-12 Thread Evgeniy Ivanov


Evgeniy Ivanov  added the comment:

it is more readable

--

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



[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-12 Thread Evgeniy Ivanov


Evgeniy Ivanov  added the comment:

or another example:

def my_func(x):
 something_do


my_func(x) if x > 100 else 

--

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



[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-12 Thread Evgeniy Ivanov


Evgeniy Ivanov  added the comment:

this wrong example

now i'm use this
x += x*2 if math.pow(x) > 386 else ''

wanted to say that doing this now

my_func(x) if x > 100 else ''

--

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



[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-12 Thread Evgeniy Ivanov


Evgeniy Ivanov  added the comment:

formaly it's not bug, this is future request ok?

--

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



[issue45456] 'pass' in 'if-else' linear expression

2021-10-12 Thread Evgeniy Ivanov


Change by Evgeniy Ivanov :


--
title: operator 'pass' in 'if-else' linear expression -> 'pass' in 'if-else' 
linear expression

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



[issue45456] operator 'pass' in 'if-else' linear expression

2021-10-13 Thread Evgeniy Ivanov


Evgeniy Ivanov  added the comment:

What about this?

if x > 2: my_func(x)

ok this code at 1 line, this code work, but...

PEP 8: E701 multiple statements on one line (colon)


Well f//k it with a pass
Why not add an empty action operator? What is the problem? Such an instruction 
has existed since the days of assembler - nop

--
status: closed -> open

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