Reading-Notes

View the Project on GitHub MohammadAl-khatib/Reading-Notes

Classes and Objects

Classes are the blueprints from which you make objects, objects, on the other hand, are sets of variables and functions that resembles real life objects.

Creating an object from a class will make its own copy from the variables of the class i.e. modifying those variables will not affect the variables of other objects created from the same class. The object’s variables and functions are accessed using dot notation.

Thinking Recursively in Python

We already talked about recursion basics, here we will discuss maintaining state and recursive data structure

Maintaining state

When dealing with recursive functions, keep in mind that each recursive call has its own execution context, so to maintain state during recursion you have to either:

see examples here

Recursive Data Structures Some data structures like list, sets, and dictionaries hold a recursive pattern, a function that add elements can be used recursively to generate those kinds of data structures.

Pytest Fixtures and Coverage

Pytest is a library used for testing Python code, when tests hold similar characteristics they are called parametrized tests, if an object or filesystem has to be shared with several tests, it is called a fixture.