Repository navigation
v4.2.0
- Deprecate batch sizes below 1 in
batcher, and inabatcherwithout an interval, contributed by @tongwentao in PR #64. ADeprecationWarningis issued when iteration starts, before the source is consumed, and the results and errors stay as they were. A test suite that turns warnings into errors fails on such a size from this release on. These sizes will raiseValueErrorin 5.0. With an interval,abatcherkeeps acceptingNoneor a size below 1 as no size limit, without a warning. - Accept a value that does not equal itself, such as
float('nan'), when it is assigned back to its own slot of aUniqueListwithon_duplicate='raise', contributed by @ShahadatTest in PR #65. 4.1.4 raisedValueError: Duplicate valuefor it, while any other value could already be assigned to its own slot. - Import the lazy exports that a module's
__getattr__serves for the names in its__all__withimport_global, contributed by @ShahadatTest in PR #66. 4.1.4 skipped every name thatdir()does not list. On Python 3.13 and later,import_global('typing')now also importsAsyncContextManager,ContextManager,ForwardRef,MatchandPattern, as it already did on 3.10 to 3.12. A lazy export that fails to resolve is still skipped. - Apply the key and value casts of a
LazyCastedDictinget, as indexing already did, contributed by @ShahadatTest in PR #67. On an int-keyed dict,d.get('3')now finds the key stored as3, andgetreturns the cast value where 4.1.4 returned the raw stored value. A raw value that the value cast rejects now raises fromgetas it does fromd[k].dict.get(d, k)still reads the raw value. - Annotate the
defaultofto_floatasint | float, contributed by @rupayon123 in PR #69. The documentedto_float('abc', default=0.0)was a type error under mypy and pyright. A# type: ignoreadded for it is now reported as unused undermypy --strict. - Keep
from python_utils.types import *working on Python 3.15, contributed by @maoxor in PR #70. Python 3.15 removedtyping.ByteStringandtyping.no_type_check_decorator, so the star import raisedAttributeErrorthere. Both names stay exported on 3.10 to 3.14, at their 4.1.4 positions in__all__, and 3.15 joins the CI matrix and the classifiers. - Choose the binary prefix of
scale_1024from the exact integer threshold, contributed by @ShahadatTest in PR #71. 4.1.4 took the prefix from a logarithm, which rounded an integer just below a boundary up to it:scale_1024(2**60 - 1, 9)returned(1.0, 6)andscale_1024(2**50 - 1, 9)returned(0.9999999999999991, 5), whilescale_1024(2**40 - 1, 9)already returned(1023.9999999990687, 3). Every power now behaves like the lower ones:(1024.0, 5)and(1023.9999999999991, 4), so a progressbar2DataSizeprints1024.0 PiBwhere 4.1.4 printed1.0 EiBfor a value a few bytes below an exbibyte. Only ints take the exact comparison. Any other number goes throughfloat()as before. - Keep the return type of a custom
containerinacontainer, contributed by @ShahadatTest in PR #72. The overloads only typedlist,setandtuple, soawait acontainer(source, frozenset)was a type error under mypy and pyright and its result came back asAny, while the call already worked at runtime. A fourth overload types any factory that takes the collected items, sofrozenset[int]anddeque[int]are inferred now. Runtime behaviour is unchanged. A# type: ignorewritten for such a call is now reported as unused undermypy --strict, and a factory that does not return a collection, such assum, is rejected withtype-varinstead ofcall-overload.
Signed on 2026-11-12 with ppt sign, after the release.
The files above are the exact PyPI uploads for this version, verified by sha256 against PyPI before signing.
Each file has a GPG signature (.asc, key 149325FD15904E9C4EB89E95E81444E9CE1F695D) and a Sigstore bundle (.sigstore.json).
SHA256SUMS.asc signs the checksum list.
Rebuilt files, if any: none.
How to verify: https://github.com/WoLpH/python-project-tools/blob/master/VERIFY.md