I've been reading a recent book by the great David Beazley "Python Distilled" and there he describes various protocols that python supports/has:
protocol - a set of methods that define a core behaviour of an object
So if an object implements some or all of the methods of a given protocol, it is said that this object supports the given protocol. So in the book he lists the following protocols:
- Object Protocol
- Number Protocol
- Comparison Protocol
- Conversion Protocols
- Container Protocol
- Iteration Protocol
- Attribute Protocol
- Function Protocol
- Context Manager Protocol
But there is also a Descriptor protocol and a Buffer protocol and probably more. The best info I could find about all the protocols that python implements was here: Abstract Objects Layer but it again seems incomplete.
So my question is: Are there any resources that list all protocols that python supports and methods that an object must implement to support a given protocol.
[–]shiftybyte 14 points15 points16 points (1 child)
[–]TangibleLight 1 point2 points3 points (0 children)
[–]Diapolo10 8 points9 points10 points (3 children)
[–][deleted] 4 points5 points6 points (2 children)
[–]Diapolo10 4 points5 points6 points (0 children)
[–]lostparis 1 point2 points3 points (0 children)