Skip to content

jwalsh/advanced-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Python Exercises

This repository contains a collection of exercises and examples covering advanced Python concepts and techniques. It is designed to help Python developers enhance their skills and gain a deeper understanding of the language’s advanced features.

Getting Started

make install 
make venv
make new-exercise

Primary Topics

  • Introduced in Python 2.4 (2005)
  • Similar concepts: Annotations (Java), Attributes (C#)
  • Introduced in Python 2.2 (2001)
  • Similar concepts: Iterator (Java), IEnumerable (C#)
  • Introduced in Python 2.5 (2006)
  • Similar concepts: try-with-resources (Java), using (C#)
  • Introduced in Python 2.2 (2001)
  • Similar concepts: Reflection (Java), Reflection (C#)
  • Introduced in Python 2.2 (2001)
  • Similar concepts: Property (C#), Getter/Setter (Java)
  • Introduced in Python 2.6 (2008)
  • Similar concepts: Interface (Java), Abstract Class (C#)
  • Coroutines introduced in Python 2.5 (2006)
  • Async/await syntax introduced in Python 3.5 (2015)
  • Similar concepts: Coroutines (C#), CompletableFuture (Java)
  • Introduced in Python 1.0 (1994)
  • Similar concepts: Operator Overloading (C++), Operator Overloading (C#)
  • List comprehensions introduced in Python 2.0 (2000)
  • Generator expressions introduced in Python 2.4 (2005)
  • Similar concepts: Stream API (Java), LINQ (C#)
  • Introduced in Python 2.2 (2001)
  • Similar concepts: Lambda Expressions (Java), Anonymous Functions (C#)
  • One-to-Many and Many-to-Many Relationships
  • Modeling Pet, Category, Tag
  • Passing arguments to decorators
  • Decorators with optional arguments
  • Important functions in the itertools module
  • Creating efficient iterators and combinatoric generators
  • Useful functions in the functools module
  • Partial function application and reducing functions
  • Singleton, Factory, and Observer patterns
  • Implementing design patterns in Python
  • Threading and multiprocessing modules
  • Concurrent execution and parallel processing
  • Custom exceptions and exception hierarchies
  • Contextual exception handling and logging
  • Code introspection and manipulation
  • Modifying behavior at runtime
  • Profiling and benchmarking code
  • Techniques for optimizing Python performance
  • Mocking and patching in unit tests
  • Integration testing and test automation

New Language Features

  • Avoiding naming conflicts
  • Creating reusable libraries
  • Packaging and distributing code
  • Effective logging techniques
  • Configuring and managing log messages
  • Serializing and deserializing objects
  • Working with JSON, Pickle, and other formats
  • Socket programming
  • Client-server communication
  • Extracting data from websites
  • Using libraries like BeautifulSoup and Scrapy
  • Creating visual representations of data
  • Using libraries like Matplotlib and Seaborn
  • Building graphical user interfaces
  • Using frameworks like Tkinter and PyQt
  • Interacting with databases
  • Using libraries like SQLAlchemy and Psycopg2
  • Designing and building APIs
  • Using frameworks like Flask and FastAPI

Foundational Topics

  • Declaring variables
  • Primitive data types (int, float, bool, str)
  • Type conversion
  • if-else statements
  • for and while loops
  • break, continue, and pass statements
  • Defining and calling functions
  • Parameters and arguments
  • Return values
  • Creating and manipulating lists
  • Accessing elements
  • List methods and functions
  • Tuples and immutability
  • Creating and working with dictionaries
  • Accessing and modifying key-value pairs
  • Sets and set operations
  • String manipulation
  • Formatting strings
  • Common string methods
  • Reading from and writing to files
  • File modes and permissions
  • Context managers for file handling
  • Importing modules
  • Creating and using packages
  • Namespace and scope
  • Handling exceptions with try-except
  • Raising exceptions
  • Custom exception classes
  • Classes and objects
  • Inheritance and polymorphism
  • Encapsulation and data hiding

Instructions

For each topic, complete the exercise in the corresponding Python file. The exercises are designed to help you practice and understand the advanced Python language features.

Resources

Official Documentation

Books

Online Tutorials and Courses

Blogs and Articles

Communities and Forums

Podcasts

YouTube Channels

About

Advanced Python concepts and techniques

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published