Mark Smith - Stupid Things I've Done With Python

Stupid Things I've Done With Python I have a GitHub repository that contains a compilation of all the awful code I've written over the years, abusing features like metaclasses, decorators, various _dunder_ methods, and the mutable nature of Python's underlying data structures. It's a funny way to see how Python works under the hood, but it's also educational. Really! Each of the tricks is entertainingly terrible. But they're also mostly self-contained ways to see what happens when you override certain behaviours of the Python language. Anyone with an intermediate level of Python understanding should be able to follow along and learn something. I will cover: Replacing an imported module with a class, so attribute lookups can be @properties, with hilarious results. Overriding the `__sub__` magic method to create a hyphenated, fuzzy-matching version of a boolean. Using _getattr_ to save time implementing all the functions in the `math` module. Using _eq_ to make things that aren't really the same look the same. This talk is an entertaining tour of the Python Data Model, and the things you can do - if you're so inclined.