Skip to: site menu | section menu | main content

IronPython in Action News

News on the IronPython in Action book and sources.

Currently viewing: Front Page

Python Magic Method Reference

written by Michael Foord, on 4/16/09 1:47 PM.

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.

Leave a Reply

Back to top