Created
November 3, 2018 16:10
-
-
Save pawelswiecki/e7cbce3aecbf0a13833484b8bee0ef1a 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
class Railroad: | |
pass | |
def feed_animal(animal: BaseAnimal): | |
piece_of_railroad = Railroad() | |
animal.eat(piece_of_railroad) | |
lassie = Dog() | |
feed_animal(lassie) # It's safe, Lassie won't touch it anyway! | |
# no mypy errors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment