Skip to content

v0.5.11

Compare
Choose a tag to compare
@ionite34 ionite34 released this 15 Feb 09:11
· 81 commits to main since this release
60cdf2e

Added:

  • View.address property that returns the memory address of an object, like PyObject.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()
  • 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 in PyObject and other structures.

Fixes:

  • Skip weakref check when detach=False

Full Changelog: v0.5.10...v0.5.11