[New-bugs-announce] [issue32550] STORE_ANNOTATION bytecode is unnecessary and can be removed.

Mark Shannon report at bugs.python.org
Sun Jan 14 07:05:38 EST 2018


New submission from Mark Shannon <mark at hotpy.org>:

The STORE_ANNOTATION bytecode is used to implement annotations.
The code 
     name : ann
is equivalent to 
    __annotations__['name'] = ann        

Consequently,
    STORE_ANNOTATION name

can be trivially replaced with 
    LOAD_NAME  __annotations__
    LOAD_CONST 'name'
    STORE_SUBSCR

----------
components: Interpreter Core
messages: 309918
nosy: Mark.Shannon
priority: normal
severity: normal
stage: needs patch
status: open
title: STORE_ANNOTATION bytecode is unnecessary and can be removed.
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32550>
_______________________________________


More information about the New-bugs-announce mailing list