- Flush a nonempty
abatcherbatch 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.
- Count the time that passed across a daylight saving change in
timesincefor 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 atimedeltafromtimesince, where 4.1.1 printed a wall-clock difference.
- 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,IOErrorandABCdnow becomei_pad,io_errorandab_cdinstead ofipad,ioerrorandabcd. - Keep a plural acronym whole in
camel_to_underscore, soGetURLsbecomesget_urlsinstead ofget_ur_ls.IDsandUserIDsstill becomeidsanduser_ids.
- Keep
UniqueListmembership 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
UniqueListmembership in sync for slice assignment,extend,pop,remove,clear,+=and*=, soextendand+=no longer add duplicates and removed values can be added again. - Accept one-shot iterables in
UniqueListslice assignment, allow a slice to reuse the values it replaces, and reject a slice that repeats a value. - Make
copy.copyandcopy.deepcopyof aUniqueListreturn a working copy with its own membership. - Leave
UniqueListmembership unchanged wheninsertfails, and answerinfor an unhashable value the way alistdoes. - Make
CastedDictandLazyCastedDictload frompickleon every protocol, including pickles written by 4.0.1, and stopcopy.copyandcopy.deepcopyfrom casting the stored values a second time. - Cast what
setdefaultand|=store in aCastedDictorLazyCastedDict. ANonedefault is stored as it is. - Cast the key of a
LazyCastedDictonce when it is stored. It was cast twice. - Let keyword arguments win over the mapping in
updateand the constructor of the casted dicts, asdictdoes. - Make
!=the opposite of==forSliceableDeque, and compare unequal to a set when an item is unhashable. - Remove the iterable of mappings from the
DictUpdateArgstype alias. The code never accepted that shape. - Log the traceback in
Logged.exception(), and name the caller in every record ofLoggedinstead oflogger.py. Code that passedstacklevel=2to work around the wrong caller now points one frame too high. - Stop
Logurudfrom 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
LoggedorLogurudwith a type such asintorstr. - Use the whole match in
to_intandto_floatfor a pattern without a group, and never return a negative power fromscale_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, soHTTP_OKbecomeshttp_ok. - Let
import_globalimport a nested module that nothing imported before. - Cancel the pending item of
abatcherwhen 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
abatcherafter a full batch, and accept an iterator whose__anext__returns a future. - Accept a plain function as
on_timeoutinaio_generator_timeout_detector. - Truncate
format_timeexactly for a precision below one second, and print the placeholder fornan. - Limit the first sleep of
timeout_generatorandaio_timeout_generatortomaximum_interval. - Let
acountcount down to astopwith a negative step. - Log a skipped call of
samplethrough 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 inwraps_classmethod. - Return the value of
total_seconds()fromtimedelta_to_secondsfor a duration with a fraction. - Correct docstrings that described something else than the code does, among
them
to_strreturningbytesand the timeouts that read0as none. - Run the timing tests on a fake clock, so they no longer depend on sleep
accuracy, and ship
conftest.pyin the sdist.
- Allow
uv_build0.12.x, contributed by @felixonmars in PR #49. - Keep the
python_utils.typesexport list unique. - Delay newly published dependencies and development tools by 14 days before resolution.