Skip to main content

All Questions

2votes
1answer
288views

Selective method inheritance

I have a lot of classes that are just a CRUD interface for microservices. They only have a param for the endpoint and some of the methods get_list / get_item / create / update / delete / activate / ...
xpy's user avatar
  • 129
6votes
3answers
9kviews

Interfaces in Python, multiple inheritance vs. a home-made solution

I am writing a Python framework. In order to ensure a class has some properties, I make base "interface" classes like: class BananaContainer: def __init__(self): self._bananas = [] @...
mguijarr's user avatar
9votes
2answers
911views

Is Python's inheritance an "is-a" style of inheritance or a compositional style?

Given that Python allows for multiple inheritance, what does idiomatic inheritance in Python look like? In languages with single inheritance, like Java, inheritance would be used when you could say ...
Iain's user avatar
  • 450
11votes
1answer
2kviews

Using Python's Method Resolution Order for Dependency Injection - is this bad?

I watched Raymond Hettinger's Pycon talk "Super Considered Super" and learned a little bit about Python's MRO (Method Resolution Order) which linearises a classes "parent" classes in a deterministic ...
Iain's user avatar
  • 450

close