Ruff
Ruff is an extremely fast Python linter and code formatter written in Rust. The main advantage of Ruff is its speed. Ruff is 10-100 times …
Ruff is an extremely fast Python linter and code formatter written in Rust. The main advantage of Ruff is its speed. Ruff is 10-100 times …
A metaclass in Python is a class that defines the behavior of other classes that are its instances. In a sense, a metaclass can be …
The contextlib.redirect_stdout function in Python temporarily redirects the output of print() and other writing operations. It's useful when you need to write output to a …
Built-in functions all() and any() are applied to sequences (lists, tuples, etc.) and return a bool value. all(iterable) — returns True if all elements in …
Deep copying creates a completely independent copy of the original list, including all nested structures. This means that changes to nested lists or objects will …
Typer is a library for creating command-line interface applications in Python. It makes it easy to create CLI applications with support for arguments, options, subcommands, …
As a solo Python developer working with a Windows production server, I faced several challenges keeping my Python applications running reliably. PM2, while primarily known …
In Python, when working in an interactive shell (such as REPL or Jupyter Notebook), you can use the underscore symbol _ to access the result …
The itertools module is a tool in Python for working with iterable objects. It provides various functions for creating and manipulating iterators, making it an …
In this lecture, we will examine such important topics as containers and related concepts of iterators and generators. To conclude, we will look at decorators. …
It's often not understood immediately, so just start using it and understanding will come sooner or later on its own. class Person: def __init__(self, name, …
Variables that are defined at the class level are called attributes. class Person: name = 'Alex' age = 10 name and age are class attributes. …
What is dir() and how does it differ from __dict__? In Python, dir() is used to return a list of all attributes and methods of …
cachetools is a small yet powerful library for caching that provides various caching strategies, such as LRU (Least Recently Used), LFU (Least Frequently Used), and …
itertools.tee() is an interesting function from the itertools module that allows you to create multiple independent copies of the same iterator. 🗣️ This is useful …
Dateutil provides extensions to the methods already available in datetime and includes features for processing raw data. Dateutil is divided into several subclasses: easter — …
The built-in itertools package (https://docs.python.org/3/library/itertools.html) contains a collection of useful iterators. Let's talk about a few of them: combinations — returns a tuple in sorted …
functools.partialmethod This function allows you to create a partial method of a class by pre-fixing some of the method's arguments. This is useful when you …
A small utility that allows you to adjust the volume at any time by simply hovering your mouse over the taskbar and then scrolling up/down. …
itertools.combinations_with_replacement is a useful function from the itertools module that allows you to create combinations of elements with repetition. This is convenient when you need …
Tenacity is a library for implementing automatic retries when errors occur. It allows you to easily add retry logic to any function or block of …