Starting with Python 3.12, passing a PyLong into Py_SIZE() triggers an
assertion. PyLong (and the whole C API) is transitioning to be more
opaque and expose fewer implementation details.
Fewer function pointer calls by moving the wrapper creation logic to the downcast function
This also paves the way for some classes to have custom wrapper creation logic
Enabled with `pstats-python-profiler 1`, requires recent version of PStats server.
Currently, it is limited to the main thread only. Support for other threads may be added at a later date.
- `interrogate_function_is_constructor()`
- `interrogate_function_is_destructor()`
- `interrogate_wrapper_parameter_is_optional()`
- `interrogate_wrapper_parameter_is_scoped_enum()`
- `interrogate_wrapper_parameter_is_final()`
Only `interrogate_wrapper_parameter_is_optional()` requires a rebuild of the database with the new changes.
This redoes the handling of `obj[n] = item` to occur in InterrogateBuilder instead so that it doesn't prevent the same remap from being used as getitem.
This fixes the non-const variant of InstanceList[n].
We can't call PyErr_Restore() without a valid thread state, which won't exist in a custom thread if we just called PyGILState_Release(). Not sure how this has ever worked.
* Support converting BitMask types to int
* BitArray constructor accepts a Python long of arbitrary size
* DoubleBitMask (and QuadBitMask, by extension) supports Python long in constructor
* Support for pickling (except DoubleBitMask)
* All of them now properly define __bool__()
* More unit tests
Fixes#886
The intended purpose of this function is to restore an exception
that has already been raised and saved with PyErr_Fetch. It should
not be used to raise new exceptions nor should it be used to clear
the current exception.
The especially egregious example is
`PyErr_Restore(exc_type, nullptr, nullptr);`
as the null value may not be handled correctly.