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

Formale Metadaten

Titel
Using and abusing Python’s double-underscore methods and attributes
Serientitel
Teil
94
Anzahl der Teile
169
Autor
Lizenz
CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache

Inhaltliche Metadaten

Fachgebiet
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_: