Feedback

X
A Guide to Python's Magic Methods

A Guide to Python's Magic Methods

17 Ungluers have Faved this Work

This short guide is the culmination of a few months’ worth of blog posts. The subject is magic methods.

What are magic methods? They’re everything in object-oriented Python. They’re special methods that you can define to add ”magic” to your classes. They’re always surrounded by double underscores (e.g. __init__ or __lt__). They’re also not as well documented as they need to be. All of the magic methods for Python appear in the same section in the Python docs, but they’re scattered about and only loosely organized. There’s hardly an example to be found in that section (and that may very well be by design, since they’re all detailed in the language reference, along with boring syntax descriptions, etc.). 

Why read this book? Have your say.

You must be logged in to comment.

Rights Information

Are you the author or publisher of this work? If so, you can claim it as yours by registering as an Unglue.it rights holder.

Downloads

This work has been downloaded 548 times via unglue.it ebook links.
  1. 548 - pdf (CC BY-NC-SA) at Internet Archive.

Keywords

  • Computer programming
  • Computers
  • Computers / Programming Languages
  • Computers / Programming Languages / Python
  • Python (Computer program language)

Links

web: https://github.com/RafeKettler/magicmethods

Editions

edition cover

Share

Copy/paste this into your site: