Get the latest tech news
Uncommon Uses of Python in Commonly Used Libraries (2022)
Some off-the-beaten uses of Python learned from reading libraries.
It is a limited form of multiple inheritance, and is a parent class that simply provides functionality for subclasses, does not contain state, and is not intended to be instantiated. First, we might add imports to__init__.py when we want to refactor code that has grown into multiple modules without introducing breaking changes to existing users. It turns out that sklearn was taking advantage of a lesser-known feature of conftest.py: By having it in the root path, it ensures that pytest recognizes the modules without having to specify the PYTHONPATH.
Or read this on Hacker News