An open API service indexing awesome lists of open source software.

https://github.com/carlbordum/dynamic-inheritance

o boi
https://github.com/carlbordum/dynamic-inheritance

Last synced: 21 days ago
JSON representation

o boi

Awesome Lists containing this project

README

        

# dynamic inheritance
A true classic when it comes to OOP patterns; refer to your text book.

``` python
import random

class Cat:
def speak(self):
print('Meow!')

class Dog:
def speak(self):
print('Woof!')

class RandomAnimal(random.choice((Cat, Dog))):
pass

if __name__ == '__main__':
RandomAnimal().speak()

```

``` python
Woof!
```

(please let me know (e.g. submit pr) if you have other awesome ideas)