__str__ or __repr__? The two methods that help Python objects to display themselves

preview_player
Показать описание
What happens if you print an object in Python? You might already know that its __str__ magic method is invoked. Except that this isn't *always* the case, because there are actually *two* magic methods that control how objects are displayed, __str__ and __repr__. In this video, I review these two methods, when they're called, and how you can and should think about them.

Рекомендации по теме
Комментарии
Автор

📊 Enjoyed learning about str and repr? Take your Python skills further!

- New Python insights every Monday
- Actionable suggestions to make you a more fluent Python coder
- Deep explanations that go beyond basic syntax

- Dozens of courses covering Python, Git, and Pandas
- Twice-monthly office hours for personalized help
- Exclusive members-only lectures
- Private Discord community for ongoing support

👉 Join other Python developers improving their skills today!

ReuvenLerner
Автор

interesting as always! Thank you Reuven.

MrMe-uy
join shbcf.ru