[issue45974] Using walrus produces different/unoptimized bytecode

2021-12-03 Thread Fatih Kilic


Fatih Kilic  added the comment:

Ah, I see. Thanks!

--

___
Python tracker 

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



[issue45974] Using walrus produces different/unoptimized bytecode

2021-12-03 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

See: https://bugs.python.org/issue42282 
and the reason for not backporting this: 
https://bugs.python.org/issue42282#msg380506

--
components: +Interpreter Core -Parser
nosy: +BTaskaya
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
type: behavior -> performance
versions:  -Python 3.11

___
Python tracker 

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



[issue45974] Using walrus produces different/unoptimized bytecode

2021-12-03 Thread Fatih Kilic


New submission from Fatih Kilic :

So, what I mean by unoptimized bytecode is, for example when you type `a = 10 * 
10`, the resulting bytecode is the following: 
```
LOAD_CONST 0 (100)
STORE_NAME 0 (a)
...
```

However, when you type, `(a := 10 * 10) == None`, the resulting bytecode is the 
following:
```
LOAD_CONST 0 (10)
LOAD_CONST 0 (10)
BINARY_MULTIPLY
DUP_TOP
STORE_NAME 0 (a)
...
```

I don't know if this is intentional, but shouldn't the resulting bytecode be 
the following:
```
LOAD_CONST 0 (100)
DUP_TOP
STORE_NAME 0 (a)
...
```

--
components: Parser
messages: 407610
nosy: FKLC, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Using walrus produces different/unoptimized bytecode
type: behavior
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

___
Python tracker 

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