Elk is an object system for Python inspired by Moose for Perl. It implements many of the features of Moose including:
- attribute delegation
- default attribute values
- lazy attribute initialisation
- read-only attributes
- required attributes
- attribute type constraints
- roles
- method modifiers
class Point(elk.Elk):
x = elk.ElkAttribute(mode='rw', type=int)
y = elk.ElkAttribute(mode='rw', type=int)
def clear(self):
self.x = 0
self.y = 0
class Point3D(Point):
z ...
News of Foro - Perl en Español