gh-126835: Move constant unaryop & binop folding to CFG (#129550)

This commit is contained in:
Yan Yanchii 2025-02-21 18:54:22 +01:00 committed by GitHub
parent d88677ac20
commit 38642bff13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 1057 additions and 443 deletions

View file

@ -1,5 +1,5 @@
def to_tuple(t):
if t is None or isinstance(t, (str, int, complex, float, bytes)) or t is Ellipsis:
if t is None or isinstance(t, (str, int, complex, float, bytes, tuple)) or t is Ellipsis:
return t
elif isinstance(t, list):
return [to_tuple(e) for e in t]