| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,11 +54,11 @@ class Adapter(object): | |||
| 54 | 54 | >>> objects.append(Adapter(car, dict(make_noise=car_noise))) | |
| 55 | 55 | ||
| 56 | 56 | >>> for obj in objects: | |
| 57 | - ... print("A", obj.name, "goes", obj.make_noise()) | ||
| 58 | - ('A', 'Dog', 'goes', 'woof!') | ||
| 59 | - ('A', 'Cat', 'goes', 'meow!') | ||
| 60 | - ('A', 'Human', 'goes', "'hello'") | ||
| 61 | - ('A', 'Car', 'goes', 'vroom!!!') | ||
| 57 | + ... print('A {} goes {}'.format(obj.name, obj.make_noise())) | ||
| 58 | + A Dog goes woof! | ||
| 59 | + A Cat goes meow! | ||
| 60 | + A Human goes 'hello' | ||
| 61 | + A Car goes vroom!!! | ||
| 62 | 62 | """ | |
| 63 | 63 | def __init__(self, obj, adapted_methods): | |
| 64 | 64 | """We set the adapted methods in the object's dict""" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments