- Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathIntroduction_to_OOP.html
277 lines (244 loc) · 25.4 KB
/
Introduction_to_OOP.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE html>
<htmlclass="writer-html5" lang="en" >
<head>
<metacharset="utf-8" /><metacontent="Topic: Introducing object oriented programming in python, Difficulty: Easy, Category: Section" name="description" />
<metacontent="class, type, creation, definition, intro, overview, basics, meaning" name="keywords" />
<metaname="viewport" content="width=device-width, initial-scale=1.0" />
<title>Introduction to Object Oriented Programming — Python Like You Mean It</title>
<linkrel="stylesheet" href="../_static/pygments.css" type="text/css" />
<linkrel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<linkrel="stylesheet" href="../_static/my_theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<scriptdata-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<scriptsrc="../_static/jquery.js"></script>
<scriptsrc="../_static/underscore.js"></script>
<scriptsrc="../_static/doctools.js"></script>
<scriptasync="async" src="https://www.googletagmanager.com/gtag/js?id=UA-115029372-1"></script>
<scriptsrc="../_static/gtag.js"></script>
<scriptcrossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script>window.MathJax={"tex": {"inlineMath": [["$","$"],["\\(","\\)"]],"processEscapes": true},"options": {"ignoreHtmlClass": "tex2jax_ignore|mathjax_ignore|document","processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
<scriptdefer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<scriptsrc="../_static/js/theme.js"></script>
<linkrel="index" title="Index" href="../genindex.html" />
<linkrel="search" title="Search" href="../search.html" />
<linkrel="next" title="Defining a New Class of Object" href="ClassDefinition.html" />
<linkrel="prev" title="Module 4: Object Oriented Programming" href="../module_4.html" />
</head>
<bodyclass="wy-body-for-nav">
<divclass="wy-grid-for-nav">
<navdata-toggle="wy-nav-shift" class="wy-nav-side">
<divclass="wy-side-scroll">
<divclass="wy-side-nav-search" >
<ahref="../index.html" class="icon icon-home"> Python Like You Mean It
</a>
<divclass="version">
1.4
</div>
<divrole="search">
<formid="rtd-search-form" class="wy-form" action="../search.html" method="get">
<inputtype="text" name="q" placeholder="Search docs" />
<inputtype="hidden" name="check_keywords" value="yes" />
<inputtype="hidden" name="area" value="default" />
</form>
</div>
</div><divclass="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<pclass="caption" role="heading"><spanclass="caption-text">Table of Contents:</span></p>
<ulclass="current">
<liclass="toctree-l1"><aclass="reference internal" href="../intro.html">Python Like You Mean It</a></li>
<liclass="toctree-l1"><aclass="reference internal" href="../module_1.html">Module 1: Getting Started with Python</a></li>
<liclass="toctree-l1"><aclass="reference internal" href="../module_2.html">Module 2: The Essentials of Python</a></li>
<liclass="toctree-l1"><aclass="reference internal" href="../module_2_problems.html">Module 2: Problems</a></li>
<liclass="toctree-l1"><aclass="reference internal" href="../module_3.html">Module 3: The Essentials of NumPy</a></li>
<liclass="toctree-l1"><aclass="reference internal" href="../module_3_problems.html">Module 3: Problems</a></li>
<liclass="toctree-l1 current"><aclass="reference internal" href="../module_4.html">Module 4: Object Oriented Programming</a><ulclass="current">
<liclass="toctree-l2 current"><aclass="current reference internal" href="#">Introduction to Object Oriented Programming</a><ul>
<liclass="toctree-l3"><aclass="reference internal" href="#Class-vs-Type:-An-Important-Note-on-Terminology">Class vs Type: An Important Note on Terminology</a></li>
<liclass="toctree-l3"><aclass="reference internal" href="#Links-to-Official-Documentation">Links to Official Documentation</a></li>
</ul>
</li>
<liclass="toctree-l2"><aclass="reference internal" href="ClassDefinition.html">Defining a New Class of Object</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="ClassInstances.html">Instances of a Class</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="Brief_Review.html">A Brief Summary of Terms and Concepts</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="Methods.html">Methods</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="Applications_of_OOP.html">Applications of Object Oriented Programming</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="Special_Methods.html">Special Methods</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="Inheritance.html">Inheritance</a></li>
</ul>
</li>
<liclass="toctree-l1"><aclass="reference internal" href="../module_5.html">Module 5: Odds and Ends</a></li>
<liclass="toctree-l1"><aclass="reference internal" href="../changes.html">Changelog</a></li>
</ul>
</div>
</div>
</nav>
<sectiondata-toggle="wy-nav-shift" class="wy-nav-content-wrap"><navclass="wy-nav-top" aria-label="Mobile navigation menu" >
<idata-toggle="wy-nav-top" class="fa fa-bars"></i>
<ahref="../index.html">Python Like You Mean It</a>
</nav>
<divclass="wy-nav-content">
<divclass="rst-content">
<divrole="navigation" aria-label="Page navigation">
<ulclass="wy-breadcrumbs">
<li><ahref="../index.html" class="icon icon-home"></a> »</li>
<li><ahref="../module_4.html">Module 4: Object Oriented Programming</a> »</li>
<li>Introduction to Object Oriented Programming</li>
<liclass="wy-breadcrumbs-aside">
<ahref="../_sources/Module4_OOP/Introduction_to_OOP.md.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<divrole="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<divitemprop="articleBody">
<style>
/* CSS overrides for sphinx_rtd_theme */
/* 24px margin */
.nbinput.nblast.container,
.nboutput.nblast.container {
margin-bottom:19px; /* padding has already 5px */
}
/* ... except between code cells! */
.nblast.container+ .nbinput.container {
margin-top:-19px;
}
.admonition>p:before {
margin-right:4px; /* make room for the exclamation icon */
}
/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */
.math {
text-align: unset;
}
</style>
<divclass="section" id="Introduction-to-Object-Oriented-Programming">
<h1>Introduction to Object Oriented Programming<aclass="headerlink" href="#Introduction-to-Object-Oriented-Programming" title="Permalink to this headline"></a></h1>
<p>Our first foray into the essentials of Python introduced us to the <aclass="reference external" href="http://www.pythonlikeyoumeanit.com/Module2_EssentialsOfPython/Basic_Objects.html">basic object types: numbers, strings, and lists</a>. Likewise, our discussion of NumPy was centered around the <aclass="reference external" href="http://www.pythonlikeyoumeanit.com/Module3_IntroducingNumpy/IntroducingTheNDarray.html">N-dimensional array</a>. These types of objects are distinguished in large part by the different functions that are bound to them. Functions bound to
objects are known as <strong>methods</strong>. For example, where a string possesses methods designed to manipulate its sequence of characters, a NumPy array possesses methods for operating on the numerical data bound to that array.</p>
<divclass="highlight-python notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># Different types of objects can possess different methods</span>
<spanclass="o">>>></span><spanclass="n">string</span><spanclass="o">=</span><spanclass="s2">"hello world"</span>
<spanclass="o">>>></span><spanclass="n">string</span><spanclass="o">.</span><spanclass="n">capitalize</span><spanclass="p">()</span><spanclass="c1"># use the string-method `capitalize`</span>
<spanclass="s1">'Hello world'</span>
<spanclass="o">>>></span><spanclass="kn">import</span><spanclass="nn">numpy</span><spanclass="k">as</span><spanclass="nn">np</span>
<spanclass="o">>>></span><spanclass="n">array</span><spanclass="o">=</span><spanclass="n">np</span><spanclass="o">.</span><spanclass="n">array</span><spanclass="p">([[</span><spanclass="mi">0</span><spanclass="p">,</span><spanclass="mi">1</span><spanclass="p">,</span><spanclass="mi">2</span><spanclass="p">],</span>
<spanclass="o">...</span><spanclass="p">[</span><spanclass="mi">3</span><spanclass="p">,</span><spanclass="mi">4</span><spanclass="p">,</span><spanclass="mi">5</span><spanclass="p">]])</span>
<spanclass="o">>>></span><spanclass="n">array</span><spanclass="o">.</span><spanclass="n">sum</span><spanclass="p">()</span><spanclass="c1"># use the array-method `sum`</span>
<spanclass="mi">15</span>
</pre></div>
</div>
<p>More generally, an object can possess data, known as <strong>attributes</strong>, which summarize information about that object. For example, the array-attributes <codeclass="docutils literal notranslate"><spanclass="pre">ndim</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">shape</span></code> provide information about the indexing-layout of that array’s numerical data.</p>
<divclass="highlight-python notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># accessing an object's attributes</span>
<spanclass="o">>>></span><spanclass="n">array</span><spanclass="o">.</span><spanclass="n">ndim</span>
<spanclass="mi">2</span>
<spanclass="o">>>></span><spanclass="n">array</span><spanclass="o">.</span><spanclass="n">shape</span>
<spanclass="p">(</span><spanclass="mi">2</span><spanclass="p">,</span><spanclass="mi">3</span><spanclass="p">)</span>
</pre></div>
</div>
<p>In this module, we will learn to define our own, customized object types with distinct collections of attributes and methods. In this way, we will be using Python as an “objected oriented” programming language; this will greatly expand our capabilities as Python users, and deepen our understanding of the language itself.</p>
<p>As a sneak peek example, let’s create our own class of objects known as <codeclass="docutils literal notranslate"><spanclass="pre">Rectangle</span></code>:</p>
<divclass="highlight-python notranslate"><divclass="highlight"><pre><span></span><spanclass="k">class</span><spanclass="nc">Rectangle</span><spanclass="p">:</span>
<spanclass="sd">""" A Python object that describes the properties of a rectangle """</span>
<spanclass="k">def</span><spanclass="fm">__init__</span><spanclass="p">(</span><spanclass="bp">self</span><spanclass="p">,</span><spanclass="n">width</span><spanclass="p">,</span><spanclass="n">height</span><spanclass="p">,</span><spanclass="n">center</span><spanclass="o">=</span><spanclass="p">(</span><spanclass="mf">0.0</span><spanclass="p">,</span><spanclass="mf">0.0</span><spanclass="p">)):</span>
<spanclass="sd">""" Sets the attributes of a particular instance of `Rectangle`.</span>
<spanclass="sd"> Parameters</span>
<spanclass="sd"> ----------</span>
<spanclass="sd"> width : float</span>
<spanclass="sd"> The x-extent of this rectangle instance.</span>
<spanclass="sd"> height : float</span>
<spanclass="sd"> The y-extent of this rectangle instance.</span>
<spanclass="sd"> center : Tuple[float, float], optional (default=(0, 0))</span>
<spanclass="sd"> The (x, y) position of this rectangle's center"""</span>
<spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">width</span><spanclass="o">=</span><spanclass="n">width</span>
<spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">height</span><spanclass="o">=</span><spanclass="n">height</span>
<spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">center</span><spanclass="o">=</span><spanclass="n">center</span>
<spanclass="k">def</span><spanclass="fm">__repr__</span><spanclass="p">(</span><spanclass="bp">self</span><spanclass="p">):</span>
<spanclass="sd">""" Returns a string to be used as a printable representation</span>
<spanclass="sd"> of a given rectangle."""</span>
<spanclass="k">return</span><spanclass="s2">"Rectangle(width=</span><spanclass="si">{w}</span><spanclass="s2">, height=</span><spanclass="si">{h}</span><spanclass="s2">, center=</span><spanclass="si">{c}</span><spanclass="s2">)"</span><spanclass="o">.</span><spanclass="n">format</span><spanclass="p">(</span><spanclass="n">h</span><spanclass="o">=</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">height</span><spanclass="p">,</span>
<spanclass="n">w</span><spanclass="o">=</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">width</span><spanclass="p">,</span>
<spanclass="n">c</span><spanclass="o">=</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">center</span><spanclass="p">)</span>
<spanclass="k">def</span><spanclass="nf">compute_area</span><spanclass="p">(</span><spanclass="bp">self</span><spanclass="p">):</span>
<spanclass="sd">""" Returns the area of this rectangle</span>
<spanclass="sd"> Returns</span>
<spanclass="sd"> -------</span>
<spanclass="sd"> float"""</span>
<spanclass="k">return</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">width</span><spanclass="o">*</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">height</span>
<spanclass="k">def</span><spanclass="nf">compute_corners</span><spanclass="p">(</span><spanclass="bp">self</span><spanclass="p">):</span>
<spanclass="sd">""" Computes the (x, y) corner-locations of this rectangle, starting with the</span>
<spanclass="sd"> 'top-right' corner, and proceeding clockwise.</span>
<spanclass="sd"> Returns</span>
<spanclass="sd"> -------</span>
<spanclass="sd"> List[Tuple[float, float], Tuple[float, float], Tuple[float, float], Tuple[float, float]]"""</span>
<spanclass="n">cx</span><spanclass="p">,</span><spanclass="n">cy</span><spanclass="o">=</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">center</span>
<spanclass="n">dx</span><spanclass="o">=</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">width</span><spanclass="o">/</span><spanclass="mf">2.0</span>
<spanclass="n">dy</span><spanclass="o">=</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">height</span><spanclass="o">/</span><spanclass="mf">2.0</span>
<spanclass="k">return</span><spanclass="p">[(</span><spanclass="n">cx</span><spanclass="o">+</span><spanclass="n">x</span><spanclass="p">,</span><spanclass="n">cy</span><spanclass="o">+</span><spanclass="n">y</span><spanclass="p">)</span><spanclass="k">for</span><spanclass="n">x</span><spanclass="p">,</span><spanclass="n">y</span><spanclass="ow">in</span><spanclass="p">((</span><spanclass="n">dx</span><spanclass="p">,</span><spanclass="n">dy</span><spanclass="p">),</span><spanclass="p">(</span><spanclass="n">dx</span><spanclass="p">,</span><spanclass="o">-</span><spanclass="n">dy</span><spanclass="p">),</span><spanclass="p">(</span><spanclass="o">-</span><spanclass="n">dx</span><spanclass="p">,</span><spanclass="o">-</span><spanclass="n">dy</span><spanclass="p">),</span><spanclass="p">(</span><spanclass="o">-</span><spanclass="n">dx</span><spanclass="p">,</span><spanclass="n">dy</span><spanclass="p">))]</span>
</pre></div>
</div>
<p>An instance of this <codeclass="docutils literal notranslate"><spanclass="pre">Rectangle</span></code> class is an individual rectangle whose <em>attributes</em> include its width, height, and center-location. Additionally, we can use the rectangle’s <em>methods</em> (its attributes that are functions) to compute its area and the locations of its corners.</p>
<divclass="highlight-python notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># create a rectangle of width 4, height 10, centered at (0, 0)</span>
<spanclass="c1"># here __init__ is executed and the width/height/center attributes are set</span>
<spanclass="o">>>></span><spanclass="n">rect1</span><spanclass="o">=</span><spanclass="n">Rectangle</span><spanclass="p">(</span><spanclass="mi">4</span><spanclass="p">,</span><spanclass="mi">10</span><spanclass="p">)</span>
<spanclass="c1"># the __repr__ method defines how a rectangle instance will be displayed here</span>
<spanclass="c1"># in the console</span>
<spanclass="o">>>></span><spanclass="n">rect1</span>
<spanclass="n">Rectangle</span><spanclass="p">(</span><spanclass="n">width</span><spanclass="o">=</span><spanclass="mi">4</span><spanclass="p">,</span><spanclass="n">height</span><spanclass="o">=</span><spanclass="mi">10</span><spanclass="p">,</span><spanclass="n">center</span><spanclass="o">=</span><spanclass="p">(</span><spanclass="mi">0</span><spanclass="p">,</span><spanclass="mi">0</span><spanclass="p">))</span>
<spanclass="c1"># compute the area for this particular rectangle</span>
<spanclass="o">>>></span><spanclass="n">rect1</span><spanclass="o">.</span><spanclass="n">compute_area</span><spanclass="p">()</span>
<spanclass="mi">40</span>
<spanclass="c1"># compute the corner-locations of this rectangle</span>
<spanclass="o">>>></span><spanclass="n">rect1</span><spanclass="o">.</span><spanclass="n">compute_corners</span><spanclass="p">()</span>
<spanclass="p">[(</span><spanclass="mf">2.0</span><spanclass="p">,</span><spanclass="mf">5.0</span><spanclass="p">),</span><spanclass="p">(</span><spanclass="mf">2.0</span><spanclass="p">,</span><spanclass="o">-</span><spanclass="mf">5.0</span><spanclass="p">),</span><spanclass="p">(</span><spanclass="o">-</span><spanclass="mf">2.0</span><spanclass="p">,</span><spanclass="o">-</span><spanclass="mf">5.0</span><spanclass="p">),</span><spanclass="p">(</span><spanclass="o">-</span><spanclass="mf">2.0</span><spanclass="p">,</span><spanclass="mf">5.0</span><spanclass="p">)]</span>
</pre></div>
</div>
<p>Just like any other Python object that we have encountered, we can put our <codeclass="docutils literal notranslate"><spanclass="pre">Rectangle</span></code>s in lists, store them as values in dictionaries, pass them to functions, reference them with multiple variables, and so on.</p>
<p>Popular STEM, data analysis, and machine learning Python libraries rely heavily on the ability to define custom classes of Python objects. For example, <aclass="reference external" href="https://pandas.pydata.org/">pandas</a> defines a spreadsheet-like <codeclass="docutils literal notranslate"><spanclass="pre">DataFrame</span></code> class; <aclass="reference external" href="https://pytorch.org/">PyTorch</a>, <aclass="reference external" href="https://mxnet.incubator.apache.org/">MXNet</a>, and <aclass="reference external" href="https://www.tensorflow.org/">TensorFlow</a> each define tensor classes that are capable of <aclass="reference external" href="https://en.wikipedia.org/wiki/Automatic_differentiation">automatic
differentiation</a>, which is critically important for training neural networks. Understanding Python’s class system will greatly improve your ability to leverage libraries like these (Shameless plug: refer to <aclass="reference external" href="https://mygrad.readthedocs.io">MyGrad</a> if you are interested in seeing a simple pure-Python/NumPy implementation of an auto-differentiation library).</p>
<p>Moving forward, we will discuss the essential <em>class definition</em>, which will permit us to define our own class (a.k.a. type) of object. Next, we will learn about creating distinct <em>instances</em> of a given object type and about defining methods. This will lead to our first encounter with <em>special methods</em>, which enable us to affect how our object type behaves with Python’s various operators. For example, we can define how the <codeclass="docutils literal notranslate"><spanclass="pre">+</span></code> operator interacts with our objects. Lastly, we will briefly
discuss the concept of class inheritance.</p>
<divclass="admonition note">
<pclass="admonition-title fa fa-exclamation-circle"><strong>Takeaway:</strong></p>
<p>The goal of this module is to understand how to define and utilize our own class of Python objects. This will greatly mature our understanding of Python as an object-oriented language, and will expand our ability to fully leverage all of Python’s features.</p>
</div>
<divclass="section" id="Class-vs-Type:-An-Important-Note-on-Terminology">
<h2>Class vs Type: An Important Note on Terminology<aclass="headerlink" href="#Class-vs-Type:-An-Important-Note-on-Terminology" title="Permalink to this headline"></a></h2>
<p>Before proceeding any further, it is worthwhile to draw our attention to the fact that the terms “type” and “class” are practically synonymous in Python. Thus far, we have only encountered the term “type” to distinguish objects from one another, e.g. <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code> belongs to the type <codeclass="docutils literal notranslate"><spanclass="pre">int</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">"cat"</span></code> belongs to the type <codeclass="docutils literal notranslate"><spanclass="pre">str</span></code>. However, we will soon study <em>class</em> definitions for making new types objects, and soon introduce functions like <codeclass="docutils literal notranslate"><spanclass="pre">issubclass</span></code> into our lexicon. That being said, know that
<em>class</em> and <em>type</em> mean the same thing! There are historical reasons for the coexistence of these two terms, but <aclass="reference external" href="https://www.python.org/download/releases/2.2/descrintro/">since Python 2.2</a> concepts of type and class have been unified.</p>
<p>In practice, people tend to reserve the word “type” to refer to built-in types (e.g. <codeclass="docutils literal notranslate"><spanclass="pre">int</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">str</span></code>) and “class” to refer to user-defined types. Again, in the modern versions of Python, these terms carry no practical distinction.</p>
<divclass="admonition note">
<pclass="admonition-title fa fa-exclamation-circle"><strong>Takeaway:</strong></p>
<p>The terms “type” and “class” are synonymous; they both refer to the encapsulating definition of a specific type/class of Python object, with all of its attributes. Although they are not treated synonymously within the Python language - we will write class definitions, not type definitions, and we will use <codeclass="docutils literal notranslate"><spanclass="pre">type</span></code> to inspect an object and not <codeclass="docutils literal notranslate"><spanclass="pre">class</span></code> - these distinctions are merely relics of versions of Python long passed.</p>
</div>
</div>
<divclass="section" id="Links-to-Official-Documentation">
<h2>Links to Official Documentation<aclass="headerlink" href="#Links-to-Official-Documentation" title="Permalink to this headline"></a></h2>
<ulclass="simple">
<li><p><aclass="reference external" href="https://docs.python.org/3/tutorial/classes.html#a-first-look-at-classes">Python Tutorial: A First Look at Classes</a></p></li>
</ul>
</div>
</div>
</div>
</div>
<footer><divclass="rst-footer-buttons" role="navigation" aria-label="Footer">
<ahref="../module_4.html" class="btn btn-neutral float-left" title="Module 4: Object Oriented Programming" accesskey="p" rel="prev"><spanclass="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<ahref="ClassDefinition.html" class="btn btn-neutral float-right" title="Defining a New Class of Object" accesskey="n" rel="next">Next <spanclass="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<divrole="contentinfo">
<p>© Copyright 2021, Ryan Soklaski.</p>
</div>
Built with <ahref="https://www.sphinx-doc.org/">Sphinx</a> using a
<ahref="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <ahref="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function(){
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>