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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of python

python

Photo of libraries

libraries

Photo of uncommon uses

uncommon uses

Related news:

News photo

Show HN: Fast Thermodynamic Calculations in Python

News photo

The Evolution of Caching Libraries in Go

News photo

Use keyword-only arguments in Python dataclasses