Protocols and Practices Enforcing in Python Through Bytecode and Inspection

Protocols and Practices Enforcing in Python Through Bytecode and Inspection

EuroPython Conference via YouTube Direct link

Enforcing Protocols • Interfaces, Signatures. Types, Assertions are all ways to express a protocol. • They can provide expectations about joints between your code and users code . But they can do lit…

6 of 12

6 of 12

Enforcing Protocols • Interfaces, Signatures. Types, Assertions are all ways to express a protocol. • They can provide expectations about joints between your code and users code . But they can do lit…

Class Central Classrooms beta

YouTube videos curated by Class Central.

Classroom Contents

Protocols and Practices Enforcing in Python Through Bytecode and Inspection

Automatically move to the next video in the Classroom when playback concludes

  1. 1 Intro
  2. 2 Why? • Being more the Ubrary kind of developer tend to write a lot of independent pieces When you put those together to do the real job it's not always easy to comunicate their design and philosophy …
  3. 3 Then comes documentation • To avoid misuses you try to cover examples for most reasonable use cases in documentation You quickly discover that your definition of reasonable is not as common as you th…
  4. 4 Protocols & Expectations • Protocols define how components interact with the rest of the world. Invest time in enforcing them and refuse violations • Developers have expectations out of your librarie…
  5. 5 Protocols & Expectations • Protocols define how components interact with the rest of the world. Invest time in enforcing them and refuse violations.
  6. 6 Enforcing Protocols • Interfaces, Signatures. Types, Assertions are all ways to express a protocol. • They can provide expectations about joints between your code and users code . But they can do lit…
  7. 7 Enforcing Protocols Interfaces. Signatures. Types. Assertions are all ways to express a protocol • They can provide expectations about joints between your code and users code • But they can do little…
  8. 8 The Context • Python is a Dynamic language with powerful inspection techniques.
  9. 9 The Context • Python is a Dynamic language with powerful inspection techniques • Inspection is often used for Debugging but it's a powerful tool to check expectations
  10. 10 The Context • Checking for anti-patterns is something static code analysis tools usually do But they are one more dependency and plece to integrate into build pipeline. They are usually pretty comple…
  11. 11 The Context • Checking for anti-patterns is something static code analysis tools usually do • But they are one more dependency and piece to integrate into build pipeline. • They are usually pretty co…
  12. 12 For Example? . I used code inspection to ensure no files are left behind clue to a failure in any method called when a resource is destroyed

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.