Advanced Python
This tutorial series explains the advanced Python concepts and helps you understand how and why things work in Python under the hood.
To learn advanced Python, you need to have basic Python knowledge and some practical experience in Python programming.
Section 1. Variables & Memory Management
- References – learn about references and how reference counting works in Python.
- Garbage collection – understand the garbage collection and how to interact with Python Garbage collector via the
gc
module. - Dynamic typing – explain to you how dynamic typing works and understand the differences between static types and dynamic types.
- Mutable & Immutable objects – introduce you to mutable and immutable objects in Python.
- is operator – help you understand object identity and equality, and how to use the
is
operator to check if two variables reference the same object. - None – learn about the None object and how to use it properly.
Section 2. Integer types
- Integers – learn about the integer and how Python stores the integers in the memory.
- Floor division operator (//) – introduce you to the floor division operator (//) and how to use it effectively.
- Modulo operator (%) – explain how the module operator (%) works in Python.
bool
– explain how Python boolean works under the hood.- The
and
operator – learn how to use theand
operator effectively. - The
or
operator – show you how to use theor
operator.
Section 3. Float
- Float – explain how Python represents floating-point numbers internally and how to test two floats for equality.
- Converting float to int – show you how to convert float to int.
- Rounding – learn how to round a floating-point number to a specified number of digits after the decimal point.
Section 4. Decimal
- Decimal – learn about the
decimal
module that provides support for fast correctly-rounded decimal floating-point arithmetic.
Section 5. Variable scopes
- Variable scopes – explain to you the variable scopes and help understand the built-in, local, and global variables.
- Nonlocal scopes and nonlocal variables – understand the nonlocal scopes and how to change variables of the nonlocal scopes using the nonlocal keyword.
Section 6. Closures
- Closures – help you understand the closures in Python and how to define closures.
Section 7. Decorators
- Decorators – explain to you the decorator and show you how to develop a simple decorator in Python.
- Decorators with arguments – show you how to define a decorator that accepts one or more arguments.
- Class Decorators – illustrate how to define a class as a decorator.
Section 8. Named Tuples
- Named Tuples – learn how to use named tuples.
Section 9. Sequence Types
- Sequence types – learn about sequences and their basic operations
- Lists vs. Tuples – explain the main differences between the tuple and list.
- Slicing – show you how to use slicing to extract data from or assign data to a sequence.
- Custom Sequence Type – learn about the custom sequence type and show you how to use a custom sequence type to define the Fibonacci sequence.
Section 10. Iterators and Iterables
- Iterators – learn about the iterator protocol and how to define a custom iterator.
- Iterators vs. Iterables – understand iterators and iterables, and the differences between them
- iter() – explain to you how the iter() function works and how to use it effectively.
Section 11. Generators
- Generator functions – introduce you to the generator functions and how to use generators to create iterators.
- Generator expressions – show you an alternative syntax for creating a generator object.
Section 12. Context Managers
- Context Managers – learn about context managers and how to use them effectively.