Skip to content

Latest commit

 

History

History
145 lines (131 loc) · 7.91 KB

CHANGELOG.md

File metadata and controls

145 lines (131 loc) · 7.91 KB

Changelog

Unreleased

  • Deprecate batch sizes below 1 in batcher, and in abatcher without an interval, contributed by @tongwentao in PR #64. A DeprecationWarning is 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 raise ValueError in 5.0. With an interval, abatcher keeps accepting None or 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 a UniqueList with on_duplicate='raise', contributed by @ShahadatTest in PR #65. 4.1.4 raised ValueError: Duplicate value for 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__ with import_global, contributed by @ShahadatTest in PR #66. 4.1.4 skipped every name that dir() does not list. On Python 3.13 and later, import_global('typing') now also imports AsyncContextManager, ContextManager, ForwardRef, Match and Pattern, 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 LazyCastedDict in get, as indexing already did, contributed by @ShahadatTest in PR #67. On an int-keyed dict, d.get('3') now finds the key stored as 3, and get returns the cast value where 4.1.4 returned the raw stored value. A raw value that the value cast rejects now raises from get as it does from d[k]. dict.get(d, k) still reads the raw value.
  • Annotate the default of to_float as int | float, contributed by @rupayon123 in PR #69. The documented to_float('abc', default=0.0) was a type error under mypy and pyright. A # type: ignore added for it is now reported as unused under mypy --strict.

4.1.4 - 2026-10-21

  • Build from the source distribution with uv_build 0.13 and later. The build requirement was uv_build>=0.11,<0.13, so a frontend other than uv, such as python -m build or a distribution package build, refused to build 4.1.3 once uv_build 0.13 was the installed version. The bound is now <1, contributed by @dvzrv in PR #61 and widened on top. uv itself was never stopped by the bound, since it builds with its bundled backend regardless.

4.1.3 - 2026-10-19

  • Flush a nonempty abatcher batch when its interval expires instead of waiting a full interval again after each item, contributed by @harbinresearcher in PR #60. A source that stalls after a partial batch now yields that batch after one interval, where 4.1.2 took up to two. A source faster than the interval gets its batches cut at the deadline, so the item that arrives just after it opens the next batch instead of closing the current one. An item that arrives exactly at the deadline still joins the batch it was waiting on.

4.1.2 - 2026-10-13

  • Count the time that passed across a daylight saving change in timesince for a timezone-aware datetime, contributed by @pralav-25 in PR #56 and completed in PR #58. Two datetimes that share a tzinfo subtract by wall clock, so an hour went missing or was counted twice around the change. A pendulum datetime in the future across such a change is no longer described as -1 hours ago.
  • Raise the error of a tzinfo whose utcoffset() raises or returns something other than a timedelta from timesince, where 4.1.1 printed a wall-clock difference.

4.1.1 - 2026-10-11

  • Split a short acronym from the word after it in camel_to_underscore, as the docstring describes, contributed by @pralav-25 in PR #57. IPad, IOError and ABCd now become i_pad, io_error and ab_cd instead of ipad, ioerror and abcd.
  • Keep a plural acronym whole in camel_to_underscore, so GetURLs becomes get_urls instead of get_ur_ls. IDs and UserIDs still become ids and user_ids.

4.1.0 - 2026-10-02

  • Keep UniqueList membership in sync when replacing an indexed item, and leave membership unchanged when the index is out of range, contributed by @shkyyy18 in PR #51.
  • Keep UniqueList membership in sync for slice assignment, extend, pop, remove, clear, += and *=, so extend and += no longer add duplicates and removed values can be added again.
  • Accept one-shot iterables in UniqueList slice assignment, allow a slice to reuse the values it replaces, and reject a slice that repeats a value.
  • Make copy.copy and copy.deepcopy of a UniqueList return a working copy with its own membership.
  • Leave UniqueList membership unchanged when insert fails, and answer in for an unhashable value the way a list does.
  • Make CastedDict and LazyCastedDict load from pickle on every protocol, including pickles written by 4.0.1, and stop copy.copy and copy.deepcopy from casting the stored values a second time.
  • Cast what setdefault and |= store in a CastedDict or LazyCastedDict. A None default is stored as it is.
  • Cast the key of a LazyCastedDict once when it is stored. It was cast twice.
  • Let keyword arguments win over the mapping in update and the constructor of the casted dicts, as dict does.
  • Make != the opposite of == for SliceableDeque, and compare unequal to a set when an item is unhashable.
  • Remove the iterable of mappings from the DictUpdateArgs type alias. The code never accepted that shape.
  • Log the traceback in Logged.exception(), and name the caller in every record of Logged instead of logger.py. Code that passed stacklevel=2 to work around the wrong caller now points one frame too high.
  • Stop Logurud from crashing on a message with a brace in it. A message without arguments is logged as written, so braces that were doubled to avoid the crash now show doubled.
  • Keep the value of a class that combines Logged or Logurud with a type such as int or str.
  • Use the whole match in to_int and to_float for a pattern without a group, and never return a negative power from scale_1024.
  • Count every day once in timesince, describe a negative timedelta by its size, and accept a timezone-aware datetime.
  • Keep an acronym whole before an underscore or a digit in camel_to_underscore, so HTTP_OK becomes http_ok.
  • Let import_global import a nested module that nothing imported before.
  • Cancel the pending item of abatcher when the consumer stops early. A source that is an async generator ends at that point, where a leaked task used to take its next item.
  • Restart the interval of abatcher after a full batch, and accept an iterator whose __anext__ returns a future.
  • Accept a plain function as on_timeout in aio_generator_timeout_detector.
  • Truncate format_time exactly for a precision below one second, and print the placeholder for nan.
  • Limit the first sleep of timeout_generator and aio_timeout_generator to maximum_interval.
  • Let acount count down to a stop with a negative step.
  • Log a skipped call of sample through the logger of its module instead of the root logger, which installed a handler on it.
  • Keep the name, docstring and signature of a function under listify, and leave the annotations of the wrapped function alone in wraps_classmethod.
  • Return the value of total_seconds() from timedelta_to_seconds for a duration with a fraction.
  • Correct docstrings that described something else than the code does, among them to_str returning bytes and the timeouts that read 0 as none.
  • Run the timing tests on a fake clock, so they no longer depend on sleep accuracy, and ship conftest.py in the sdist.

4.0.1 - 2026-08-30

  • Allow uv_build 0.12.x, contributed by @felixonmars in PR #49.
  • Keep the python_utils.types export list unique.
  • Delay newly published dependencies and development tools by 14 days before resolution.