/
anjana-vakil-using-and-abusing-pythons-double-underscore-methods-and-attributes.json
23 lines (23 loc) · 2.62 KB
/
anjana-vakil-using-and-abusing-pythons-double-underscore-methods-and-attributes.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"copyright_text": "Creative Commons Attribution license (reuse allowed)",
"description": "Anjana Vakil - Using and abusing Python\u2019s double-underscore methods and attributes\n[EuroPython 2016]\n[21 July 2016]\n[Bilbao, Euskadi, Spain]\n(https://ep2016.europython.eu//conference/talks/using-and-abusing-pythons-double-underscore-methods-and-attributes)\n\nPython\u2019s double-underscore ('`__`') methods and attributes go by many\nnames, including \u201cspecial\u201d, \u201cdunder\u201d, and \u201cmagic\u201d. You already use\nsome, like `__init__`, but there are many more!\n\nIn this talk, we\u2019ll see how dunders can be useful, silly, dangerous,\nand fun! We\u2019ll trick Python\u2019s arithmetic and comparison operators.\nWe\u2019ll make objects behave like dictionaries and containers. We\u2019ll\nreduce an object\u2019s memory usage, and speed up membership tests. We\u2019ll\neven try some naughty function hacks!\n\n-----\n\nThe curious Python methods and attributes surrounded by double\nunderscores ('`__`') go by many names, including \u201cspecial\u201d, \u201cdunder\u201d,\nand \u201cmagic\u201d. You probably use some of them, like `__init__`, every\nday. But that\u2019s just the tip of the iceberg!\n\nIn this talk, we\u2019ll explore the weird and wonderful world of the\ndouble-underscore, and find out how dunders can be useful, silly,\ndangerous, and just fun! We\u2019ll play pranks on Python\u2019s builtin\noperators for arithmetic and comparison. We\u2019ll make arbitrary objects\nbehave like dictionaries and containers. We\u2019ll reduce an object\u2019s\nmemory usage, and speed up tests for membership. We\u2019ll even try some\nnaughty function hacks that we should never use in real life!\n\nYou'll get the most out of this talk if you're already comfortable\nwriting object-oriented Python code. If you already use special dunder\nmagic in your own code, that's excellent! You\u2019ll have a chance to\nshare your tips & tricks with the rest of the audience at the end of\nthe talk.\n\n**Talk repo**: https://github.com/vakila/dunders\n\n",
"duration": 1860,
"language": "eng",
"recorded": "2016-08-04",
"related_urls": [
"https://ep2016.europython.eu//conference/talks/using-and-abusing-pythons-double-underscore-methods-and-attributes",
"https://github.com/vakila/dunders"
],
"speakers": [
"Anjana Vakil"
],
"tags": [],
"thumbnail_url": "https://i.ytimg.com/vi/WKu7T976WkA/maxresdefault.jpg",
"title": "Using and abusing Python\u2019s double-underscore methods and attributes",
"videos": [
{
"type": "youtube",
"url": "https://www.youtube.com/watch?v=WKu7T976WkA"
}
]
}