__str__ Dunder Method : Design Patterns In Python

Channel:
Subscribers:
24,900
Published on ● Video Link: https://www.youtube.com/watch?v=X84ZnxYGKFs



Duration: 2:05
469 views
3


Documentation : https://sbcode.net/python/decorator/#dunder-__str__-method

When you print() an object, it will print out the objects type and memory location in hex.

You can change this default output by implementing the __str__ dunder method in your class. Dunder is short for saying double underscore.

Dunder methods are predefined methods in python that you can override with your own implementations.

(Book)Sometimes you just want to switch off your computer and read from a book. So, all GoF patterns are discussed in my Design Patterns In Python book
https://www.amazon.com/dp/B08XLJ8Z2J : ASIN B08XLJ8Z2J
https://www.amazon.com/dp/B08Z282SBC : ASIN B08Z282SBC

#dunder
#strDunder
#designPatterns
#pythonDesignPatterns







Tags:
Design Patterns In Python
python design patterns
B08XLJ8Z2J
__str__
str dunder
python str dunder
python __str__
B08Z282SBC