markmap | ||||||
---|---|---|---|---|---|---|
|
- A small course to explain metaprogramming in Python.
- This has been prepared for a 1,5h workshop and shared for everyone interested.
Explained in Markdown to allow a conversion to mindmap using Markmap. Each chapter will have code snippets under "workshop" folder to explain with examples.
- Python 3.10
- Jupyter Notebook (pip3 install notebook)
- (optional) MarkDown with VSCode+Markmap
- Introduction
- What is a Class
- Meta vs Hierarchy
- type function
- Decorators
- The making of
- Real world examples
- Metaclasses
- Do you need them?
- Real world examples (don't loose them)
- Meta == Greek word for "beyond"
- Metadata == data about data
- Metaprogramming == programs that manipulate programs
- string
- A function
- A class definition
- An instance of a class
- Everything
- Object that creates a new object, or instance
- Contains functions and attributes
- Can create an instance
- Who creates a class?
- See the workshop
- A class can inherit another
- Can use all attributes and functions of the base/super class
- In python any Class is always a derived class, at least of the superclass 'object'
- See the workshop
- Multiple inheritance is possible
- the search for attributes inherited from a parent class goes depth-first, left-to-right, not searching twice
- How classes and instances are created
- How inheritance work
- What is type
- Let's do a trip
- From the concept
- Through decorator construction
- Until real examples
- Workshop
- The making of a decorator
- Real world examples
- Do we need them?
- Real world examples