File tree Expand file tree Collapse file tree 2 files changed +1
-26
lines changed Expand file tree Collapse file tree 2 files changed +1
-26
lines changed Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22
33pip install --upgrade pip
44pip install black codespell flake8 isort mypy pytest pyupgrade tox
Original file line number Diff line number Diff line change @@ -77,14 +77,6 @@ def buy_pet(self, name: str) -> Pet:
7777 return pet
7878
7979
80- # Additional factories:
81-
82-
83- # Create a random animal
84- def random_animal (name : str ) -> Pet :
85- """Let's be dynamic!"""
86- return random .choice ([Dog , Cat ])(name )
87-
8880
8981# Show pets with various factories
9082def main () -> None :
@@ -95,27 +87,10 @@ def main() -> None:
9587 Here is your lovely Cat<Lucy>
9688 >>> pet.speak()
9789 meow
98-
99- # A shop that sells random animals
100- >>> shop = PetShop(random_animal)
101- >>> for name in ["Max", "Jack", "Buddy"]:
102- ... pet = shop.buy_pet(name)
103- ... pet.speak()
104- ... print("=" * 20)
105- Here is your lovely Cat<Max>
106- meow
107- ====================
108- Here is your lovely Dog<Jack>
109- woof
110- ====================
111- Here is your lovely Dog<Buddy>
112- woof
113- ====================
11490 """
11591
11692
11793if __name__ == "__main__" :
118- random .seed (1234 ) # for deterministic doctest outputs
11994 shop = PetShop (random_animal )
12095 import doctest
12196
You can’t perform that action at this time.
0 commit comments