This simple program returns a different output when compiled with mypyc than when run in vanilla Python:
def main() -> None:
match ("X", "Y"):
case ("X", "Y") | ("X", "Z"):
print("THERE")
case _:
print("OTHER")
$ python -c 'import matchtest; matchtest.main()'
THERE
$ mypyc matchtest.py; python -c 'import matchtest; matchtest.main()'
running build_ext
copying build\lib.win-amd64-cpython-312\matchtest.cp312-win_amd64.pyd ->
OTHER
(Thanks for mypyc, it's a very nice tool!)
This simple program returns a different output when compiled with mypyc than when run in vanilla Python:
(Thanks for mypyc, it's a very nice tool!)