The Real Python Podcast cover image

Seeking Faster Text Processing & Python's .__repr__() vs .__str__()

The Real Python Podcast

00:00

How to Create a Date Time Object

There's a repper function that's sort of built in and just R E P R and then you call it with the parentheses. And again, you see this in the REPL when you just type the object name and hit return. The other way to do it is to type the objectname and then it's a special method. So you can call it by putting a dot and then DUNDER, REPPER, and then again, a couple other underscores and then your parentheses. If you were to then unalign below that type print, parentheses put today inside of it the object today, close that off. It would then actually print out a much more human readable 2023,

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app