You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
py/parse: Generate const int variables for annotated assignments.
This commit extends the parser's behaviour to also recognise constant
integer assignments even when the assignment itself has an "int" type
annotation.
For assignments like "var = const(1)" the compiler generates an
optimised constant load bytecode instruction, whilst before this change
assignments like "var: int = const(1)" would generate a sequence of
bytecode instructions to create a new integer object, create a variable,
and perform the assignment.
This fixes#15608.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
0 commit comments