home.social

#teachingpython — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #teachingpython, aggregated by home.social.

  1. I was on the #teachingpython podcast! I got to talk with Kelly and Julian about Python, #CircuitPython, UF2 bootloader troubles, and #embedded systems in general. It was a lot of fun. teachingpython.fm/156

  2. [PyCrumble No. 6] #Python __dunder__ special methods:
    What is the difference between __repr__, __str__ and __format__? (4/4)

    You can use __format__ also to create your own format specifications. Just be creative! 🤠
    #teachingpython #pythonlearning

  3. [PyCrumble No. 5] #Python __dunder__ special methods:
    What is the difference between __repr__, __str__ and __format__? (3/4)

    __format__ ensures that you can use Pythons format string mini-language with your objects. A basic usage could look like this beyond.

    More about format and its mini-language next time!

    #teachingpython #pythonlearning

  4. [PyCrumble No. 4] #Python __dunder__ special methods:
    What is the difference between __repr__, __str__ and __format__? (2/4)

    __repr__ is "what the developer wants to see", __str__ is "what the user wants to see". So you always want to implement __repr__ (especially for debugging) but __str__ is not as necessary.
    #teachingpython #pythonlearning #oop #programming