in realitythe [syntax is actually so-called syntax sugar that calls the list(constructor under the hood the list data type is class that we can extend in factthe list itself extends the object classisinstance([]objecttrue as second examplewe can extend the dict classwhich issimilar to the listthe class that is constructed when using the {syntax shorthandclass longnamedict(dict)def longest_key(self)longest none for key in selfif not longest or len(keylen(longest)longest key return longest this is easy to test in the interactive interpreterlongkeys longnamedict(longkeys['hello' longkeys['longest yet' longkeys['hello ''worldlongkeys longest_key('longest yetmost built-in types can be similarly extended commonly extended built-ins are objectlistsetdictfileand str numerical types such as int and float are also occasionally inherited from overriding and super soinheritance is great for adding new behavior to existing classesbut what about changing behaviorour contact class allows only name and an -mail address this may be sufficient for most contactsbut what if we want to add phone number for our close friends