Created
November 3, 2018 20:48
-
-
Save pawelswiecki/c7ffcc6478b109fa7f188b234bf94297 to your computer and use it in GitHub Desktop.
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
from typing import Union | |
class Food: ... | |
class Meat(Food): ... | |
class Chocolate(Food): ... | |
class Dog: | |
def eat(self, food: Meat): | |
pass | |
class Human: | |
def eat(self, food: Chocolate): | |
pass | |
Animal = Union[Dog, Animal] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment