Open
Description
Pyre Bug
Bug description
Subclasses should not be able to change the type of their mutable attributes, see relevant open issue in mypy and recent discussion in python/typing
Reproduction steps
class UStr(str):
pass
class A:
foo: str
def __init__(self):
self.foo = ""
class B(A):
foo: UStr
def __init__(self):
self.foo = UStr("")
Expected behavior
Pyre should not allow the subclass B
Logs
No Errors!
Please run your reproduction steps followed by pyre rage > pyre_rage.log
, and upload the file here:
Additional context
This was run in the playground to verify, as I am not a pyre user, only bringing this to the attention of pyre due to ecosystem impact
Metadata
Metadata
Assignees
Labels
No labels