Skip to content

Releases: ionite34/einspect

v0.4.9

22 Jan 08:13
0a8e342
Compare
Choose a tag to compare

Implement dynamic string structs to reflect CPython implementation:

  • PyASCIIObject
  • PyCompactUnicodeObject
  • PyUnicodeObject

Added some macros to py_unicode

These should exactly match their C equivalents when possible

  • PyUnicode_DATA
  • PyUnicode_IS_COMPACT_ASCII
  • PyUnicode_UTF8_LENGTH
  • PyUnicode_WSTR_LENGTH
  • _PyUnicode_COMPACT_DATA
  • _PyUnicode_HAS_UTF8_MEMORY
  • _PyUnicode_HAS_WSTR_MEMORY
  • _PyUnicode_NONCOMPACT_DATA
  • _PyUnicode_UTF8
  • _PyUnicode_UTF8_LENGTH

Added MutableSequence methods for StrView:

  • __delitem__ (index / slice)
  • __setitem__ (index / slice)
  • append
  • clear
  • extend
  • insert
  • pop
  • remove
  • reverse

These new methods will not require an unsafe context normally as they check the allocated memory bounds before any resize operation. If resizing will be beyond allocated memory, an UnsafeError is raised.

An unsafe context can be entered to bypass this allocated memory check.

Fixes:

  • ViewStr will now dynamically use one of PyASCIIObject, PyCompactUnicodeObject, or PyUnicodeObject structs. Previously the single usage of PyUnicodeObject could cause out of bounds memory access.
  • PyASCIIObject and subtypes now use a mem_size that is logically equivalent to the C implementation of str.__sizeof__, and should match in all cases.

Full Changelog: v0.4.8...v0.4.9

v0.4.8

20 Jan 09:36
bb62683
Compare
Choose a tag to compare

Added

  • Py.Mem api methods (Malloc, Calloc, Realloc)
  • Add try_from and with_ref methods to PyObject

Fixes and Enhancements

  • Simplify PyUnicode field access
  • ListView and TupleView ob_item setters now will cast from PyObject and objects to the required ptr[PyObject] types

Full Changelog: v0.4.7...v0.4.8

v0.4.7

18 Jan 12:27
1e7cc07
Compare
Choose a tag to compare

Enhancements

  • Expand PyTupleObject.ob_digit setter compatibility for casts

Docs

  • Improve documentation coverage

Full Changelog: v0.4.6...v0.4.7

v0.4.6

17 Jan 06:44
7159eee
Compare
Choose a tag to compare

Added MutableSequence protocols for TupleView:

  • __getitem__ (index / slice)
  • __setitem__ (index / slice)
  • __delitem__ (index / slice)
  • __iadd__
  • append
  • clear
  • extend
  • insert
  • pop
  • remove
  • reverse

These new methods will not require an unsafe context normally as they check the allocated memory bounds before any resize operation. If resizing will be beyond allocated memory for the tuple, an UnsafeError is raised.

An unsafe context can be entered to bypass this allocated memory check.

Fixes

  • Fixed DictView.__getitem__ missing PyObject cast
  • TupleView mem_size uses base implementation from PyTupleObject for increased accuracy

Full Changelog: v0.4.5...v0.4.6

v0.4.6a1

16 Jan 16:38
48006c5
Compare
Choose a tag to compare
v0.4.6a1 Pre-release
Pre-release

Added MutableSequence protocols for TupleView:

  • __delitem__ (index / slice)
  • __setitem__ (index / slice)
  • __iadd__
  • append
  • clear
  • extend
  • insert
  • pop
  • remove
  • reverse

These new methods will not require an unsafe context normally as they check the allocated memory bounds before any resize operation. If resizing will be beyond allocated memory for the tuple, an UnsafeError is raised.

An unsafe context can be entered to bypass this allocated memory check.

Full Changelog: v0.4.5...v0.4.6a1

v0.4.5

16 Jan 12:38
41eccac
Compare
Choose a tag to compare

Adds

  • View.mem_allocated (property)
    Provides the allocated memory size of an object, as mem_size rounded up to the nearest alignment boundary.
  • Full formatting support in DictView.info()

Fixes

  • TupleView.mem_size now uses more accurate implementation from PyTupleObject

Docs

  • Added docs for structs

Full Changelog: v0.4.4...v0.4.5

v0.4.4

15 Jan 12:50
7fe7a64
Compare
Choose a tag to compare

New Structs

  • PyGC_Head

New methods for PyObject

  • is_gc
  • as_gc
  • gc_is_tracked
  • gc_may_be_tracked

New methods for View

  • is_gc
  • gc_is_tracked
  • gc_may_be_tracked

Full Changelog: v0.4.3...v0.4.4

v0.4.3

14 Jan 09:22
98a9c65
Compare
Choose a tag to compare

New

  • Add @impl decorator for built-in type attribute overrides, and orig proxy to get original attributes by @ionite34 in #16

Full Changelog: v0.4.2...v0.4.3

v0.4.2

14 Jan 02:43
2c5c961
Compare
Choose a tag to compare

Fixes

  • Fix DictView iter and delitem methods for MutableMapping protocol by @ionite34 in #15

Docs

  • Package metadata - Revert lower bound python requirement to 3.8.0 by @ionite34 in #14

Full Changelog: v0.4.1...v0.4.2

v0.4.1.post1

12 Jan 17:01
66fe1dc
Compare
Choose a tag to compare

Docs and Metadata

  • Package metadata - Revert lower bound python requirement to 3.8.0 by @ionite34 in #14

Full Changelog: v0.4.1...v0.4.1.post1