-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not generate the property for invariant container
Summary: Suppress generating properties for invariant container types. `Mapping` is invariant in its key type, example below will emit error `Signature of "my_set" incompatible with supertype "Abstract_B" [override]` in mypy. ``` from typing import Mapping class Abstract_A: pass class A(Abstract_A): pass class Abstract_B: property def my_set(self) -> Mapping[Abstract_A, int]: return {} class B(Abstract_B): property def my_set(self) -> Mapping[A, int]: return {} ``` Reviewed By: ahilger, createdbysk Differential Revision: D67674205 fbshipit-source-id: 0d5faeeaf404a9bbf1c62844bb9f6c55eb31d3c8
- Loading branch information
1 parent
55b13fa
commit 1411e8e
Showing
3 changed files
with
17 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters