name two ways to extend built-in object type what are function and class decorators used for how do you code new-style class how are new-style and classic classes different how are normal and static methods different are tools like __slots__ and super valid to use in your code how long should you wait before lobbing "holy hand grenade"test your knowledgeanswers you can embed built-in object in wrapper classor subclass the built-in type directly the latter approach tends to be simpleras most original behavior is automatically inherited function decorators are generally used to manage function or methodor add to it layer of logic that is run each time the function or method is called they can be used to log or count calls to functioncheck its argument typesand so on they are also used to "declarestatic methods (simple functions in class that are not passed an instance when called)as well as class methods and properties class decorators are similarbut manage whole objects and their interfaces instead of function call new-style classes are coded by inheriting from the object built-in class (or any other built-in typein python xall classes are new-style automaticallyso this derivation is not required (but doesn' hurt)in xclasses with this explicit derivation are new-style and those without it are "classic new-style classes search the diamond pattern of multiple inheritance trees differently--they essentially search breadth-first (across)instead of depth-first (upin diamond trees new-style classes also change the result of the type built-in for instances and classesdo not run generic attribute fetch methods such as __get attr__ for built-in operation methodsand support set of advanced extra tools including propertiesdescriptorssuperand __slots__ instance attribute lists normal (instancemethods receive self argument (the implied instance)but static methods do not static methods are simple functions nested in class objects to make method staticit must either be run through special built-in function or be decorated with decorator syntax python allows simple functions in class to be called through the class without this stepbut calls through instances still require static method declaration of coursebut you shouldn' use advanced tools automatically without carefully considering their implications slotsfor examplecan break codesuper can mask test your knowledgeanswers