Releases: aio-libs/multidict
6.6.3
6.6.2
Bug fixes
-
Fixed a memory corruption issue in the C implementation of
_md_shrink()
that could lead to segmentation faults and data loss when items were deleted from a :class:~multidict.MultiDict
. The issue was an edge case in the pointer arithmetic during the compaction phase -- by :user:bdraco
. -
Fixed format string compilation errors in debug builds on 32-bit platforms by using portable
%zd
format specifiers forPy_ssize_t
values instead of%ld
-- by :user:bdraco
.
Packaging updates and notes for downstreams
-
Re-enabled 32-bit Linux wheel builds that were disabled by default in cibuildwheel 3.0.0 -- by :user:
bdraco
.
6.6.1
Bug fixes
-
If :meth:
multidict.MultiDict.extend
, :meth:multidict.MultiDict.merge
, or :meth:multidict.MultiDict.update
raises an exception, now the multidict internal state is correctly restored.
Patch by :user:asvetlov
.Related issues and pull requests on GitHub:
#1215.
Contributor-facing changes
-
Fixed
setuptools
deprecation warning about the license specification -- by :user:asvetlov
.Related issues and pull requests on GitHub:
#1216. -
Fix compiler warnings and convert them to errors -- by :user:
asvetlov
.Related issues and pull requests on GitHub:
#1217.
6.6.0
Features
-
Added :meth:
multidict.MultiDict.merge
which copies all items from arguments if its key
not exist in the dictionary -- by :user:asvetlov
.Related issues and pull requests on GitHub:
#292. -
Stopped reallocating memory for the internal
htkeys_t
structure when inserting new items if the
multidict has deleted items and it could be collapsed in-place. Removal of
malloc()
/free()
improves the performance slightly.The change affects C implementation only, pure Python code is not changed.
Patch by :user:
asvetlov
.Related issues and pull requests on GitHub:
#1200. -
C implementation of :class:
multidict.MultiDict.getall
now is slightly faster if it returns nothing -- by :user:asvetlov
.Related issues and pull requests on GitHub:
#1212.
Improved documentation
-
Replaced docstring for :meth:
multidict.MultiDict.update
to don't use RST/markdown markup.Related issues and pull requests on GitHub:
#1203. -
Improved documentation for :meth:
multidict.MultiDict.extend
and :meth:multidict.MultiDict.update
-- by :user:asvetlov
.Related issues and pull requests on GitHub:
#1205.
Contributor-facing changes
-
When building wheels, the source distribution is now passed directly
to thecibuildwheel
invocation -- by :user:webknjaz
.Related issues and pull requests on GitHub:
#1199. -
Set up
PYTHONHASHSEED
for benchmarks execution to make measured times stable -- by :user:asvetlov
.Related issues and pull requests on GitHub:
#1202.
6.5.1
Bug fixes
-
Fixed a bug in C implementation when multidict is resized and it has deleted slots.
The bug was introduced by multidict 6.5.0 release.
Patch by :user:
asvetlov
.Related issues and pull requests on GitHub:
#1195.
Contributor-facing changes
-
A pair of code formatters for Python and C have been configured in the pre-commit tool.
Related issues and pull requests on GitHub:
#1123. -
Shorted fixture parametrization ids.
For example,
test_keys_view_xor[case-insensitive-pure-python-module]
becomestest_keys_view_xor[ci-py]
-- by :user:asvetlov
.Related issues and pull requests on GitHub:
#1192. -
The :file:
reusable-cibuildwheel.yml
workflow has been refactored to
be more generic and :file:ci-cd.yml
now holds all the configuration
toggles -- by :user:webknjaz
.Related issues and pull requests on GitHub:
#1193.
6.5.0
Features
-
Replace internal implementation from an array of items to hash table.
algorithmic complexity for lookups is switched from O(N) to O(1).The hash table is very similar to :class:
dict
from CPython but it allows keys duplication.The benchmark shows 25-50% boost for single lookups, x2-x3 for bulk updates, and x20 for
some multidict view operations. The gain is not for free:
:class:~multidict.MultiDict.add
and :class:~multidict.MultiDict.extend
are 25-50%
slower now. We consider it as acceptable because the lookup is much more common
operation that addition for the library domain.Related issues and pull requests on GitHub:
#1128.
Contributor-facing changes
-
Builds have been added for arm64 Windows
wheels and thereusable-build-wheel.yml
template has been modified to allow for
an os value (windows-11-arm
) which
does not end with the-latest
postfix.Related issues and pull requests on GitHub:
#1167.
6.4.4
Bug fixes
-
Fixed a segmentation fault when calling :py:meth:
multidict.MultiDict.setdefault
with a single argument -- by :user:bdraco
.Related issues and pull requests on GitHub:
#1160. -
Fixed a segmentation fault when attempting to directly instantiate view objects
(multidict._ItemsView
,multidict._KeysView
,multidict._ValuesView
) -- by :user:bdraco
.View objects now raise a proper :exc:
TypeError
with the message "cannot create '...' instances directly"
when direct instantiation is attempted.View objects should only be created through the proper methods: :py:meth:
multidict.MultiDict.items
,
:py:meth:multidict.MultiDict.keys
, and :py:meth:multidict.MultiDict.values
.Related issues and pull requests on GitHub:
#1164.
Miscellaneous internal changes
-
:class:
multidict.MultiDictProxy
was refactored to rely only on
:class:multidict.MultiDict
public interface and don't touch any implementation
details.Related issues and pull requests on GitHub:
#1150. -
Multidict views were refactored to rely only on
:class:multidict.MultiDict
API and don't touch any implementation
details.Related issues and pull requests on GitHub:
#1152. -
Dropped internal
_Impl
class from pure Python implementation, both pure Python and C
Extension follows the same design internally now.Related issues and pull requests on GitHub:
#1153.
6.4.3
Bug fixes
-
Fixed building the library in debug mode.
Related issues and pull requests on GitHub:
#1144. -
Fixed custom
PyType_GetModuleByDef()
when non-heap type object was passed.Related issues and pull requests on GitHub:
#1147.
Packaging updates and notes for downstreams
-
Added the ability to build in debug mode by setting :envvar:
MULTIDICT_DEBUG_BUILD
in the environment -- by :user:bdraco
.Related issues and pull requests on GitHub:
#1145.
6.4.2
6.4.1
No change release of 6.4.0 since the attestations failed to upload to GitHub