Releases: ionite34/einspect
v0.4.9
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
, orPyUnicodeObject
structs. Previously the single usage ofPyUnicodeObject
could cause out of bounds memory access. - PyASCIIObject and subtypes now use a
mem_size
that is logically equivalent to the C implementation ofstr.__sizeof__
, and should match in all cases.
Full Changelog: v0.4.8...v0.4.9
v0.4.8
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
Enhancements
- Expand
PyTupleObject.ob_digit
setter compatibility for casts
Docs
- Improve documentation coverage
Full Changelog: v0.4.6...v0.4.7
v0.4.6
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 fromPyTupleObject
for increased accuracy
Full Changelog: v0.4.5...v0.4.6
v0.4.6a1
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
Adds
View.mem_allocated
(property)
Provides the allocated memory size of an object, asmem_size
rounded up to the nearest alignment boundary.- Full formatting support in
DictView.info()
Fixes
TupleView.mem_size
now uses more accurate implementation fromPyTupleObject
Docs
- Added docs for structs
Full Changelog: v0.4.4...v0.4.5
v0.4.4
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
v0.4.2
v0.4.1.post1
Docs and Metadata
Full Changelog: v0.4.1...v0.4.1.post1