Source of screenshot::

You Are Going To Like These New Features In Python 3.11

Time signature:: 6:35

First, love this data class::

Untitled

  1. Decorated at the class level.
  2. Then I’m not sure what the class method decorator for the from_fen method means. Still, I love that there appears a distinction between the class method decorator and the passing of self in the following promote_to_queen function, which is also a class method it looks like that class method decorator has some superpower. I must find out what it is?

Source for this next section on Data Classes and specifically their use with an ORM::

Using Data Classes to create database models in Python

Data classes have been around since Python 3.7

from dataclasses import dataclass, field
@dataclass
class Point:
    x: int
    y: int
    z: int = field(default=0)

Using Data Classes in Python – Real Python

Using Data Classes in Python