We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb8982f commit fc81928Copy full SHA for fc81928
15-more-types/petbox/petbox_demo.py
@@ -26,22 +26,22 @@
26
27
out_box_si: OutBox[Siamese] = OutBox(Siamese())
28
29
+out_box = out_box_si
30
+
31
## Incompatible types in assignment
32
## expression has type "OutBox[Cat]"
-# variable has type "OutBox[Siamese]"
33
+## variable has type "OutBox[Siamese]"
34
# out_box_si = out_box
35
-out_box = out_box_si
-
36
################### Contravariance
37
38
in_box: InBox[Cat] = InBox()
39
40
in_box_si: InBox[Siamese] = InBox()
41
42
-in_box_si = in_box
43
44
45
## expression has type "InBox[Siamese]"
46
## variable has type "InBox[Cat]"
47
# in_box = in_box_si
+in_box_si = in_box
0 commit comments