v0.5.11
Added:
View.address
property that returns the memory address of an object, likePyObject.address
TypeView.restore()
restores the previously set or deleted attribute on a type- Can be called with one or more attribute names
view(int).restore("__add__", "__mul__")
to restore those attributes - Or can be called with no arguments to restore all implemented attributes
view(int).restore()
- Can be called with one or more attribute names
TypeView.__delitem__
type view subscripting now supports deletion
from einspect import view
del view(int)["__pow__"]
print(2 ** 85)
# TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'int'
view(int).restore("__pow__")
print(2 ** 85)
# 38685626227668133590597632
Enhancements:
- Added
Struct
base metaclass form of@struct
decorator, simplify internal usages inPyObject
and other structures.
Fixes:
- Skip weakref check when detach=False
Full Changelog: v0.5.10...v0.5.11