diff --git a/15-more-types/petbox/petbox.py b/15-more-types/petbox/petbox.py index 04b72ea..5b963f3 100644 --- a/15-more-types/petbox/petbox.py +++ b/15-more-types/petbox/petbox.py @@ -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 diff --git a/15-more-types/petbox/petbox_demo.py b/15-more-types/petbox/petbox_demo.py index d09cab4..a7e8bab 100644 --- a/15-more-types/petbox/petbox_demo.py +++ b/15-more-types/petbox/petbox_demo.py @@ -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 petbox import * @@ -11,7 +16,7 @@ cat_box.put(si) animal = cat_box.get() -#if TYPE_CHECKING: +# if TYPE_CHECKING: # reveal_type(animal) # Revealed: petbox.Cat*