Edge Python is functional-first, classes are state containers and namespaces, not the primary abstraction. Two patterns: state machines (a few methods that mutate the receiver) and namespaces (a bundle of related functions and constants). Single-level inheritance withDocumentation Index
Fetch the complete documentation index at: https://edgepython.com/llms.txt
Use this file to discover all available pages before exploring further.
super(), @property / @x.setter, full dunder protocol for operators, indexing, iteration, context managers (see Dunder methods). Multi-base C3 MRO, descriptors, metaclasses, __slots__ are out of scope.
State-machine pattern
Output
Namespace pattern
A class with no__init__ and no per-instance state is a namespace. Methods called on the class are unbound, no self prepended.
Output
Inheritance and super()
Single base viaclass Sub(Base):. Methods not on the subclass are looked up linearly on the base, no C3 MRO. isinstance(x, Base) walks the same chain, so Sub instances are also instances of every ancestor.
super() (zero-arg) delegates to the next class up the chain, bound to current self. Most common in __init__ to extend a base constructor.
Output
Attribute access on classes vs instances
| Access form | Resolves to |
|---|---|
MyClass.attr | class member, returned as-is (no binding) |
MyClass.method() | method called directly, no self |
instance.attr | instance __dict__ first, then class |
instance.method() | bound method, self prepended |
setattr / delattr work on instances. They do not modify the class object.
Class decorators
A class decorator wraps the class object the same way it wraps a function, the decorator is called with the class; its return binds to the name.Output
Properties
@property turns a method into a read-only attribute. @x.setter (via property.setter) makes it writable. Properties live on the class, subclasses inherit and can override either side.
Output
property(fget, fset) also works without decorator syntax.
Operator overloading and protocols
Operators, indexing, iteration, context managers, hashing,repr / str / format all dispatch through dunders: __add__ for +, __eq__ for ==, __getitem__ for x[i], __iter__ / __next__ for for, __enter__ / __exit__ for with, etc.
What is not supported
- Multi-base inheritance with proper C3 MRO.
class C(A, B):parses and both bases are stored, but resolution is a linear depth-first walk, not C3. Prefer single inheritance. - Metaclasses, descriptors (
__get__/__set__),__slots__, ABCs,__init_subclass__. @staticmethod/@classmethod, use the namespace pattern or free functions.- Async dunders, see Dunders, What’s not dispatched.