Python magic methods - __str__(), __repr__() and __format__()

Published: 12 November 2023
on channel: introvert_it
154
6

This video is about different magic methods handling different string representations of class instances. __str__() for returning user-oriented information about the instance, __repr__() - to get debugging information about the object and __format__() to handle formatted instance output.

Links:
About magic methods:
https://rszalski.github.io/magicmethods/

String formatting:
https://pyformat.info/

Today's video code:
https://bitbucket.org/introvert-it1/p...

Chapters:
0:00 Intro
1:04 __repr__() magic method
6:04 __str__() magic method and difference with __repr__()
15:26 __format__() magic method
23:26 Conclusions
--
LinkedIn community:
  / 9393328  

Discord server:
  / discord  

Check out our upcoming courses:
https://introvert-it.com/

Contact us if you want to participate in a stream or you have any questions:
info@introvert-it.com

#str #string #repr #représentation #representation #format #format() #__str__ #__format__ #__repr__ #dundler #class #objectorientedprogramming #object #dynamic #magicmethod #magic #method #pythonchallenge #python #coding #tutorial #tutorials #programming #computerscience #video #codingproblems #howto #hints #tips #tricks #tipsandtricks #manual #handling #skills #skill #code #solve #solution #advice #recipe


On this page of the site you can watch the video online Python magic methods - __str__(), __repr__() and __format__() with a duration of hours minute second in good quality, which was uploaded by the user introvert_it 12 November 2023, share the link with friends and acquaintances, this video has already been watched 154 times on youtube and it was liked by 6 viewers. Enjoy your viewing!