Python Magic Method Reference
Appendix B of IronPython in Action is a reference to all the common magic methods in Python. The magic methods are used by the Python protocols, like iteration and accessing objects by indexing; they are roughly the equivalent of interfaces in other languages.
As this appendix is a useful reference for both the Python and IronPython communities I'm putting it online.
Formatting the whole of this appendix for the web is quite a big task, so I'm putting it online in stages. Currently up are references on:
- Object creation
- Comparison methods
- Miscellaneous methods
- Containers and iteration
- Generator expressions and conditional expressions
As I get new sections up I'll post entries on this blog. Many thanks to Manning Publications for permission to reproduce it.