Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Python/module_4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Module 4: Object Oriented Programming
=====================================
In this module, we will come to see that Python is an object-oriented language. That is, the language is all about defining different types of objects that encapsulate data, and that possess functions that permit users to access and manipulate this data. Our tour through `the essentials of Python <https://www.pythonlikeyoumeanit.com/module_2.html>`_ and `the essentials of NumPy <https://www.pythonlikeyoumeanit.com/module_3.html>`_ brought us into contact with various types of objects, such as the :code:`int`, :code:`str`, :code:`list`, :code:`tuple`, :code:`dict`, and the :code:`numpy.ndarray`, to name a few. We have seen that these different types of objects have starkly different functionality from one another. We will study the syntax and constructs for creating and interacting with objects in Python. Ultimately, will find our skill sets as Python-users much fuller and more sophisticated having understood object-oriented programming in Python.

We being this module by establishing some key terminology for discussing object-oriented programming, drawing attention to the important fact that the terms 'class' and 'type' mean the same thing in modern Python. Next, we study the syntax for defining a class, and take time to distinguish between the resulting class object and the subsequent class instances that can then be created. Having defined our first custom class of object, we then study the syntax for defining class-methods, which permits us add customized functionality to our class. Further, we will introduce ourselves to Python's reserved special methods, which empower us to fully interface our class with the Python's protocols for behaving like a sequence, an iterable, a function, etc. We conclude this module with a brief discussion of the concept of inheritance, which is a mechanism by which a new class can inherit attributes from an existing class.
We begin this module by establishing some key terminology for discussing object-oriented programming, drawing attention to the important fact that the terms 'class' and 'type' mean the same thing in modern Python. Next, we study the syntax for defining a class, and take time to distinguish between the resulting class object and the subsequent class instances that can then be created. Having defined our first custom class of object, we then study the syntax for defining class-methods, which permits us to add customized functionality to our class. Further, we will introduce ourselves to Python's reserved special methods, which empower us to fully interface our class with Python's protocols for behaving like a sequence, an iterable, a function, etc. We conclude this module with a brief discussion of the concept of inheritance, which is a mechanism by which a new class can inherit attributes from an existing class.

.. toctree::
:maxdepth: 2
Expand Down