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

Protocols and Practices enforcing in Python through bytecode and inspection

Formal Metadata

Title
Protocols and Practices enforcing in Python through bytecode and inspection
Title of Series
Number of Parts
160
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
Protocols and Practices enforcing in Python through bytecode and inspection [EuroPython 2017 - Talk - 2017-07-10 - PyCharm Room] [Rimini, Italy] Python is an interpreted development language with powerful introspection features, up to allow accesso to the byte code itself to see what the virtual machine is going to do. Reaching down to byte code or low level inspection is usually a very uncommon need and it's usually only involved in debugging or understanding the interpreter internals, but it can be a powerful tool to check that third parties code that (or the code we will write ourselves in the future) sticks to some protocols or best practices that are supposed to be in place. Most of the needs for this checks are usually performed at execution time or through techniques like metaclasses and monkeypatching of third parties code, but in some cases it would be possible to inadvertently skip those checks or work them around, while verifying the resulting byte code allows us to check what's really going to be executed and enforce the required constraints