Skip to main content
py.stuartsm
  • Home
  • Learn
  • Reference
  • Glossary
  • Projects
  • Search
  • About
  1. Reference
  2. Protocols

Protocols

Dunder methods and the interfaces they implement.

  • __repr__ and __eq__The dunder methods that let an object control how it prints for debugging and how it compares for equality with ==.
  • Context ManagerAn object usable with with that guarantees its setup and cleanup code run together โ€” even if an exception happens in between.

A Python learning and reference site โ€” read to learn, search to look something up.

  • About
  • Reference
  • Curriculum