added credits to petbox examples
This commit is contained in:
parent
14e1758bf7
commit
eb8982f924
@ -1,3 +1,8 @@
|
|||||||
|
"""
|
||||||
|
Example adapted from `Atomic Kotlin` by Bruce Eckel & Svetlana Isakova,
|
||||||
|
chapter `Creating Generics`, section `Variance`.
|
||||||
|
"""
|
||||||
|
|
||||||
from typing import TypeVar, Generic, Any
|
from typing import TypeVar, Generic, Any
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
"""
|
||||||
|
Example adapted from `Atomic Kotlin` by Bruce Eckel & Svetlana Isakova,
|
||||||
|
chapter `Creating Generics`, section `Variance`.
|
||||||
|
"""
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from petbox import *
|
from petbox import *
|
||||||
@ -11,7 +16,7 @@ cat_box.put(si)
|
|||||||
|
|
||||||
animal = cat_box.get()
|
animal = cat_box.get()
|
||||||
|
|
||||||
#if TYPE_CHECKING:
|
# if TYPE_CHECKING:
|
||||||
# reveal_type(animal) # Revealed: petbox.Cat*
|
# reveal_type(animal) # Revealed: petbox.Cat*
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user