After a long hiatus, I recapture to this series of posts that I was enjoying to write. To this return more exciting I’ve chosen one of the most incredible and difficult presentations from PyCon 2011 Atlanta: How To Write Obfuscated Python. This lecture was given by Johnny Healey
Obfuscated code is the act to write a simple code but in an obscure way, that is, making it difficult to understand. In many languages this is a relatively simple task, but the clear and concise Python syntax turns this easy task into something more challenging. When writing obfuscated code, not necessarily the code will be "ugly" but rather difficult to read. For those reasons this is an extremely fun and challenging lecture. So, I’ll make the same warning of the speaker:
Python’s clean syntax can make traditional approaches to writing obfuscated code much more challenging. Fortunately, Python provides many useful abstractions that can be misused to write code that is unreadable or even deliberately misleading. This talk will provide a survey of silly python tricks that explore the boundaries of the language.
Topics:
- Redefining builtins;
- Rarely used syntax;
- Comparison edge cases;
- Things you probably shouldn’t do with decorators;
- Fun with lambdas;
- Bytecode manipulation;
- Code Objects;
Comments
comments powered by Disqus