
Explore memory management, mutability, decorators, and async programming with threading in Python, and speed up computations using the C Python API with C or C++, plus args and kwargs.
Install Visual Studio Code, a cross-platform editor that becomes an IDE with extensions; open your project, install coding tools and python dev extension packs, then generate python config files.
Learn the boolean type in Python, its true and false values, its subclass relationship to integers, truthiness of None, zero, and empty containers, short-circuiting with and/or, and is vs equality.
Explore how Python lists act as mutable containers that can store mixed data types, reveal their memory layout, and apply list comprehension for filtering and computing elements.
Demonstrate how mutable default arguments, such as a list, persist across function calls and cause bugs, and show using None to create a new list each time.
Learn how Python uses the slash for positional-only parameters and the star for keyword-only parameters, with examples of value and keyword inputs and their combinations.
Learn to build a Python command line parser with argparse, reading user options from sys.argv, defining mandatory and optional flags, type casting, and using parse_args to produce a namespace.
Explore Python's method resolution order (MRO) and how it determines which init runs when multiple inheritance occurs, using a sample a, b, c, d hierarchy.
Explore how the type function, isinstance, and issubclass work in Python, including when to use each to check an object's class or inheritance, and the differences between isinstance and issubclass.
The course was updated and covers topics from Python Version 3.12!
Course Description:
The course covers intermediate to advanced Python programming techniques.
This means that the course is not aimed at programming beginners.
This course is compact, instructive, and useful. You learn not only how to use Python well, but also more abstract concepts that are transferable to other languages, as well as how to create a good programming environment.
Prerequisites:
Creating and using variables
If-statements, loops and logical expressions
Implementing your own functions and classes
Importing from external packages
In the course we will use Visual Studio Code (VSCode) as the IDE which is free for all operating systems.
I assume that you have already Python 3.8 or newer on your system, if not you could install it via Anaconda for example.
This course consists of the following topics:
Memory management of variables in Python
Mutable and Immutable Types
Shallow and Deep Copies
The correct use of containers (list, dict, set etc.)
f-Strings formatting
Functions and Decorators
args and kwargs Arguments
Object orientation and inheritance
Special Dunder Methods
Dataclass, Enum and NamedTuple
The integration of Cython
Using the Python C API (CPython)
Using PyBind11 (introductory example)
Using Numba and Mypyc
Using multiprocessing and multithreading
Global Interpreter Lock (GIL) in Python
Using asynchronous programming
Become a pro today, in the technology of tomorrow!
See you in class!
Note:
In the course, Python is installed via Anaconda. If this is not possible for you, you can also install Python from other sources.