object-oriented programming we learned that object creation and initialization are separate operations and that python allows us to control bothalthough in almost every case we only need to customize initialization we also learned that although it is always safe to return an object' immutable data attributeswe should normally only ever return copies of an object' mutable data attributes to avoid the object' internal state leaking out and being accidentally invalidated python provides normal methodsstatic methodsclass methodsand module functions we saw that most methods are normal methodswith class methods being occasionally useful static methods are rarely usedsince class methods or module functions are almost always better alternatives the built-in repr(method calls an object' __repr__(special method where possibleeval(repr( )=xand we saw how to support this when an eval()-able representation string cannot be produced we use the base class object __repr__(method to produce non-eval()-able representation in standard format type testing using the built-in isinstance(function can provide some efficiency benefitsalthough object-oriented purists would almost certainly avoid its use accessing base class methods is achieved by calling the built-in super(functionand is essential to avoid infinite recursion when we need to call base class method inside subclass' reimplementation of that method generator functions and methods do lazy evaluationreturning (via the yield expressioneach value one at time on request and raising stopiteration when (and ifthey run out of values generators can be used wherever an iterator is expectedand for finite generatorsall their values can be extracted into tuple or list by passing the iterator returned by the generator to tuple(or list(the object-oriented approach almost invariably simplifies code compared with purely procedural approach with custom classes we can guarantee that only valid operations are available (since we implement only appropriate methods)and that no operation can put an object into an invalid state ( by using properties to apply validationonce we start using object orientation our style of programming is likely to change from being about global data structures and the global functions that are applied to the datato creating classes and implementing the methods that are applicable to them object orientation makes it possible to package up data and those methods that make sense for the data this helps us avoid mixing up all our data and functions togetherand makes it easier to produce maintainable programs since functionality is kept separated out into individual classes