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
titl
Change by Evgeniy Ivanov :
--
resolution: not a bug ->
status: closed -> open
type: compile error ->
___
Python tracker
<https://bugs.python.or
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 ''
--
__
Evgeniy Ivanov added the comment:
it is more readable
--
___
Python tracker
<https://bugs.python.org/issue45456>
___
___
Python-bugs-list mailing list
Unsub
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/issu
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
<
Evgeniy Ivanov added the comment:
formaly it's not bug, this is future request ok?
--
___
Python tracker
<https://bugs.python.org/issue45456>
___
___
Pytho
Change by Evgeniy Ivanov :
--
title: operator 'pass' in 'if-else' linear expression -> 'pass' in 'if-else'
linear expression
___
Python t
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 exis