mypy
2475643f - [mypyc] Support attributes that override properties (#14377)

Commit
3 years ago
[mypyc] Support attributes that override properties (#14377) Code like this is now supported by mypyc: ``` class B: @property def x(self) -> int: return 0 class C(B): x: int = 0 # Attribute overrides a property ``` The implementation generates implicit getter/setter methods for attributes as needed and puts them in the vtable. I had to change both the irbuild "prepare" pass (where we generate declarations), irbuild main pass (where we generate implicit accessor IRs), and codegen (where implicit properties aren't visible externally to CPython). Also fix a minor mypy bug related to overriding properties and multiple inheritance that I encountered. This doesn't handle glue methods yet.
Author
Parents
Loading