Different ways to use objects and attributes in Python

Опубликовано: 28 Декабрь 2024
на канале: Sebastiaan Mathôt
3,431
53

Check out the entire playlist with Python lectures!    • Python lectures  

This screencast demonstrates several different ways to represent objects and attributes in Python, using the example of a kitten (the object) with a name and an age (the attributes). The techniques are:

using a list
using a dict
using a namedtuple
using a (simple) class
using a class with getters (properties) and setters
using the attr package