We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Using and abusing Python’s double-underscore methods and attributes

Formal Metadata

Title
Using and abusing Python’s double-underscore methods and attributes
Title of Series
Part Number
94
Number of Parts
169
Author
License
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Anjana Vakil - Using and abusing Python’s double-underscore methods and attributes The curious Python methods and attributes surrounded by double underscores ('`__`') go by many names, including “special”, “dunder”, and “magic”. You probably use some of them, like `__init__`, every day. But that’s just the tip of the iceberg! In this talk, we’ll explore the weird and wonderful world of the double-underscore, and find out how dunders can be useful, silly, dangerous, and just fun! We’ll play pranks on Python’s builtin operators for arithmetic and comparison. We’ll make arbitrary objects behave like dictionaries and containers. We’ll reduce an object’s memory usage, and speed up tests for membership. We’ll even try some naughty function hacks that we should never use in real life! You'll get the most out of this talk if you're already comfortable writing object-oriented Python code. If you already use special dunder magic in your own code, that's excellent! You’ll have a chance to share your tips & tricks with the rest of the audience at the end of the talk. _Talk repo_: