https://github.com/lucko515/advance-python-sf
https://github.com/lucko515/advance-python-sf
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lucko515/advance-python-sf
- Owner: lucko515
- Created: 2025-03-25T12:41:44.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-03-25T19:43:31.000Z (7 months ago)
- Last Synced: 2025-03-25T20:37:03.690Z (7 months ago)
- Language: Python
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Advanced Python for Salesforce Engineers
A comprehensive 3-day course focusing on advanced Object-Oriented Programming concepts in Python.
## Course Overview
This course is designed for experienced Python developers who want to deepen their understanding of Python's Object-Oriented Programming capabilities. The focus is on advanced topics including metaclasses, descriptors, and decorators, with practical applications for building better software and frameworks.
## Prerequisites
- Solid experience with Python programming
- Understanding of basic OOP concepts (classes, inheritance, polymorphism)
- Familiarity with Python's special methods (`__init__`, `__str__`, etc.)
- Experience with exception handling and context managers## Course Structure
### Day 1: Understanding Python's Object Model
1. **Python's Object Model Fundamentals**
- Deep dive into Python's object model
- Understanding classes and instances
- Object initialization and lifecycle
- Attribute lookup and the descriptor protocol
- The importance of the `type` class2. **Introduction to Metaclasses**
- What are metaclasses and why do they exist?
- The `type` metaclass
- Understanding class creation
- Customizing class creation with metaclasses
- Examples of metaclass usage3. **Practical Applications of Metaclasses**
- Class registration patterns
- Enforcing class invariants
- Attribute validation at class definition time
- Extending classes declaratively
- Real-world use cases in frameworks### Day 2: Descriptors and Properties
4. **Advanced Method Decorators**
- Review of basic decorators
- Function vs. class decorators
- Decorators with parameters
- Useful built-in decorators (`@classmethod`, `@staticmethod`, `@property`)
- Creating robust reusable decorators5. **Method Resolution and Multiple Inheritance**
- Python's Method Resolution Order (MRO)
- The C3 linearization algorithm
- Multiple inheritance patterns
- Mixins and composition
- Understanding `super()` in depth6. **Property Descriptors**
- Introduction to the descriptor protocol
- How properties work as descriptors
- Building custom property-like descriptors
- Advanced property patterns
- Inspecting property objects7. **Custom Descriptors**
- When to create custom descriptors
- Descriptor state storage patterns
- Validation descriptors
- Lazy evaluation descriptors
- Real-world examples from frameworks### Day 3: Building Frameworks and Practical Applications
8. **Combining Metaclasses, Decorators, and Descriptors**
- Design patterns leveraging multiple techniques
- Understanding execution order
- Building declarative APIs
- Practical examples of combined techniques
- Performance and design considerations9. **Practical Real-world Examples**
- Django-inspired models system
- SQLAlchemy-inspired declarative system
- Flask-inspired routing
- Attrs-inspired class generation
- Entity-component systems for games
- Pydantic-inspired data validation