table - common operator overloading methods method implements called for __init__ constructor object creationx class(args__del__ destructor object reclamation of __add__ operator yx + if no __iadd__ __or__ operator (bitwise orx yx | if no __ior__ __repr____str__ printingconversions print( )repr( )str(x__call__ function calls (*args**kargs__getattr__ attribute fetch undefined __setattr__ attribute assignment any value __delattr__ attribute deletion del any __getattribute__ attribute fetch any __getitem__ indexingslicingiteration [key] [ : ]for loops and other iterations if no __iter__ __setitem__ index and slice assignment [keyvaluex[ :jiterable __delitem__ index and slice deletion del [key]del [ :j__len__ length len( )truth tests if no __bool__ __bool__ boolean tests bool( )truth tests (named __nonzero__ in x__lt____gt____le____ge____eq____ne__ comparisons yx yx =yx ! (or else __cmp__ in only__radd__ right-side operators other __iadd__ in-place augmented operators + (or else __add____iter____next__ iteration contexts =iter( )next( )for loopsin if no __con tains__all comprehensionsmap( , )others (__next__ is named next in x__contains__ membership test item in (any iterable__index__ integer value hex( )bin( )oct( ) [ ] [ :(replaces __oct____hex____enter____exit__ context manager (with obj as var__get____set____delete__ descriptor attributes ( attrx attr valuedel attr __new__ creation (object creationbefore __init__ all overloading methods have names that start and end with two underscores to keep them distinct from other names you define in your classes the mappings from special the basics