This repository contains various Python scripts demonstrating advanced Python concepts such as decorators, generators, concurrency, and more.
The repository covers various advanced Python topics with practical implementations, including:
- Functional programming (e.g.,
functools.partial,singledispatch) - Concurrency using
asyncio - Data classes for structured objects
- Generators for efficient data handling
- Cached properties for optimized attribute access
- HTTP requests (both synchronous and asynchronous)
git clone https://github.com/matin-ghorbani/advanced-python.gitcd advanced-python
advanced_functions.pyDemonstrates the use offunctools.partial and functional programming techniques.
cached_property.pyShows how to usefunctools.cached_property to cache computed values in a class.
concurrency.pyCompares synchronous and asynchronous HTTP requests usingasyncio andrequests.
data_classes.pyImplements Python data classes with custom__post_init__ andfield default values.
dock_typing.pyDemonstrates how to use Python's type hints for better code clarity and static analysis.
generators.pyExplains Python generators with examples ofyield and coroutine-style data processing.
requests_utils.pyContains helper functions for synchronous and asynchronous HTTP requests usingrequests.
setter_getter.pyIllustrates the use of Python's@property and@property.setter decorators for encapsulation.
single_dispatch.pyUsesfunctools.singledispatch for function overloading based on argument type.