Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
irtest
  • Loading branch information
BobTheBuidler committed Jan 6, 2026
commit 4f9ddf6507d64241c0e32a167eb608a73e4cfa1b
19 changes: 19 additions & 0 deletions mypyc/test-data/irbuild-constant-fold.test
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,25 @@ L0:
big5 = r4
return 1

[case testConstantFoldFormatArgs]
# This only tests that the callee and args are constant folded,
# it is not intended to test the result.
from typing import Any, Final

FMT: Final = "{:d} {}"

def f() -> str:
return FMT.format(400 + 20, "roll" + "up")
[out]
def f():
r0, r1, r2, r3 :: str
L0:
r0 = '420'
r1 = ' '
r2 = 'rollup'
r3 = CPyStr_Build(3, r0, r1, r2)
return r3

[case testIntConstantFoldingFinal]
from typing import Final
X: Final = 5
Expand Down
Loading