Skip to content

Commit 96590be

Browse files
Neil Leetrekhleb
Neil Lee
authored andcommitted
Added simple descriptions to files missing descriptions (trekhleb#9)
* Added simple descriptions to files missing descriptions at the top of the files. Added simple descriptions/summary for test_class_objects.py, test_inheritance.py, test_method_objects.py, test_multiple_inheritance.py, test_file_methdos.py, test_file_reading.py, test_math.py * removed trailing spaces
1 parent 446c66c commit 96590be

7 files changed

+21
-0
lines changed

src/classes/test_class_objects.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Class Definition Syntax.
22
33
@see: https://docs.python.org/3/tutorial/classes.html#class-objects
4+
5+
After defining the class attributes to a class, the class object can be created by assigning the
6+
object to a variable. The created object would have instance attributes associated with it.
47
"""
58

69

src/classes/test_inheritance.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Inheritance
22
33
@see: https://docs.python.org/3/tutorial/classes.html#inheritance
4+
5+
Inheritance is one of the principles of object-oriented programming. Since classes may share a lot
6+
of the same code, inheritance allows a derived class to reuse the same code and modify accordingly
47
"""
58

69

src/classes/test_method_objects.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Class Definition Syntax.
22
33
@see: https://docs.python.org/3/tutorial/classes.html#method-objects
4+
5+
Classes can have two types of attribute references: data or methods. Class methods are called
6+
by [variable_name].[method_name]([parameters]) as opposed to class data which lacks the ().
47
"""
58

69

src/classes/test_multiple_inheritance.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Multiple Inheritance
22
33
@see: https://docs.python.org/3/tutorial/classes.html#multiple-inheritance
4+
5+
Some classes may derive from multiple classes. This means that the derived class would have
6+
its attributes, along with the attributes of all the classes that it was derived from.
47
"""
58

69

src/files/test_file_methdos.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Methods of File Objects
22
33
@see: https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects
4+
5+
Reading from a file does not always have to be sequential. There are methods to look for
6+
specific locations in the file, much like flipping to a page in a book.
47
"""
58

69

src/files/test_file_reading.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
"""Reading and Writing Files
22
33
@see: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files
4+
5+
The process of reading and writing to a file is like finding a book and opening a book.
6+
First, the file is located, opened to the first page, then reading/writing begins until it reaches
7+
the end of the file.
48
"""
59

610

src/standard_libraries/test_math.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""Math.
22
33
@see: https://docs.python.org/3/tutorial/stdlib.html#mathematics
4+
5+
Math module is useful as many math functions are already implemented and optimized.
46
"""
57

68
import math

0 commit comments

Comments
 (0)