stillthere' no clear winner between the object-oriented and more data-oriented versions of this code they both do the same thing if we have new functions that accept polygon argumentsuch as area(polygonor point_in_polygon(polygonxy)the benefits of the object-oriented code become increasingly obvious likewiseif we add other attributes to the polygonsuch as color or textureit makes more and more sense to encapsulate that data into single class the distinction is design decisionbut in generalthe more complicated set of data isthe more likely it is to have multiple functions specific to that dataand the more useful it is to use class with attributes and methods instead when making this decisionit also pays to consider how the class will be used if we're only trying to calculate the perimeter of one polygon in the context of much greater problemusing function will probably be quickest to code and easier to use "one time onlyon the other handif our program needs to manipulate numerous polygons in wide variety of ways (calculate perimeterareaintersection with other polygonsmove or scale themand so on)we have most certainly identified an objectone that needs to be extremely versatile additionallypay attention to the interaction between objects look for inheritance relationshipsinheritance is impossible to model elegantly without classesso make sure to use them look for the other types of relationships we discussed in object-oriented designassociation and composition composition cantechnicallybe modeled using only data structuresfor examplewe can have list of dictionaries holding tuple valuesbut it is often less complicated to create few classes of objectsespecially if there is behavior associated with the data don' rush to use an object just because you can use an objectbut never neglect to create class when you need to use class adding behavior to class data with properties throughout this bookwe've been focusing on the separation of behavior and data this is very important in object-oriented programmingbut we're about to see thatin pythonthe distinction can be uncannily blurry python is very good at blurring distinctionsit doesn' exactly help us to "think outside the boxratherit teaches us to stop thinking about the box