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
{{ message }}
Repository navigation
[spec] a protocol type should be assignable to object? #1780
Mypy, pyre, and pyright all already allow protocol types to be assigned to object. Test program:
fromtypingimportProtocoldeff(x: object) ->None:
passdefg(x: int) ->None:
passclassX(Protocol):
foo: intdefh(x: X) ->None:
f(x) # OK: protocol is assignable to objectg(x) # E: protocol is not assignable to int
Activity
JelleZijlstra commentedon Jun 17, 2024
Mypy, pyre, and pyright all already allow protocol types to be assigned to
object. Test program: