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
Pyrefly doesn't allow this, but I think it should:
class A:
def __init__(self):
self.x = (42, 42)
def f(self):
self.x = (0, 0) # error: `tuple[Literal[0], Literal[0]]` is not assignable to attribute `x` with type `tuple[Literal[42], Literal[42]]`
Describe the Bug
Pyrefly doesn't allow this, but I think it should:
Sandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxlKnHAAQCCiAOuvR-ZjGPQPp8I6CABcBACjgwoYAJSt2nJVJmF89ALz1xAFgBMAGnr7ZbJd15hJ0uQqXKbazdoAMRl7JAGQAVxHQ4EnJEEABiegBVfyhRUnowH3RKf1x0ODY2C3jcACcAW1QxdB887Bgc8XxEeiERWXoAWgA%2BejgRHLtOHJgRHxz2MBYQADkSso76YHwAXyG2LxAybrAoUkIRXDyoCnCABVJl1daMHAJ6SlTIAHM%2BwohUwjZwgGUYGHoACxERYjhEAHp-kseKtCLkrv8YOh-phcJQ4P8LuhrrcUtDsjl6KgAG6oaCobCwc6XCA3HJ3VL0XDENGBNhkEQfVINbHlOD3dhaIYAZkIAEY9HN0CBpt5UMkIKyAGLQGAUNBYPBEMgioA
(Only applicable for extension issues) IDE Information
No response