Python data classes are a relatively new feature that was added in Python 3.7. They are used to create classes that are primarily used to store data. A data class is similar to a regular Python class, but it comes with additional functionality and built-in methods that make it easier to work with structured data.…
Read moreCategory: Python Features
Abstract Classes in Python
![](http://karolos.me/wp-content/uploads/2023/02/abstract1.jpg)
When it comes to writing reusable and extensible code in Python, abstract classes are an essential tool in your arsenal. Abstract classes define a set of methods that a subclass must implement, but it doesn’t provide an implementation for those methods itself. This feature makes them a powerful way to enforce certain behavior while also…
Read morePython Generators
![](http://karolos.me/wp-content/uploads/2020/02/generators-1.jpg)
Generators are a special kind of function that returns a lazy iterator. These are objects that you can loop over like a list. Unlike lists, lazy iterators do not store their data in memory. Before diving in generators, we need first to elaborate a bit on the iterators concept and the yield keyword. Iterators An iterator is…
Read morePython Decorators
![](http://karolos.me/wp-content/uploads/2021/02/decorators-1.jpg)
A decorator is a design pattern in Python that allows a user to add new functionality to an existing function or object without modifying its structure. Decorators are usually called before the definition of a function you want to decorate. Functions as First-Class Objects Before diving into decorators we need to understand how functions work in Python where they are first-class objects.…
Read more