Monday 23 March 2015

OOP

Object Oriented Programming is one of the main things about Python that I find makes it much more user friendly. The pre-existing objects such as dictionaries and lists are well formatted and the ability to create your own object types is extremely helpful and allows for a much more dynamic range of applications.

You can assign the same functionality found in the built-in objects to your own objects. This includes the special __str__, __repr__ and __eq__ functions. In addition to this you can also assign any custom functions that would be helpful when manipulating or working with your objects.

I didn't really encounter any specific problems that gave me greater insight into object oriented programming but one of the more challenging aspects was creating the __str__ function for your custom object. I found it to be the most helpful part of understanding how your objects work because it forces you to think about what exactly you are attempting to represent.


No comments:

Post a Comment