graft

Examples · a real benchmark sync

Five changes carried onto tqdm's newest release

pattonw/tqdm, a fork of tqdm/tqdm with 5 changes on v4.66.1, synced onto upstream's v4.70.1. Measured 2026-10-28.

Moved onto v4.70.1, tests pass

5 kept. Read by hand afterwards: correct. As for v4.66.2: identical content, tests pass.

Each change

ChangeOutcomeWhy
add a trainkeptapplies to the new release as is
fix some small spacing bugskeptapplies to the new release as is
move import to top of filekeptapplies to the new release as is
make train optionalkeptmerged cleanly onto the new release
use custom random state to not interfere with other generatorskeptapplies to the new release as is

Tests

pass The project's own tests ran on the carried copy (23.2 s) and on v4.70.1 as shipped (23.3 s), and the changes added no failure.

Agents

No agent was needed: every change applied as it was or was already upstream. The free plan does this on its own.

The carried diff against v4.70.1

What the pull request would change: the fork's work on top of the new release.

tqdm/std.py | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/tqdm/std.py b/tqdm/std.pyindex a3a11dd..13b0168 100644--- a/tqdm/std.py+++ b/tqdm/std.py@@ -15,6 +15,7 @@ from numbers import Number from time import time from warnings import warn from weakref import WeakSet+import random  from ._monitor import TMonitor from .utils import (@@ -138,10 +139,12 @@ class Bar:       + `a`: ascii (`charset=self.ASCII` override)       + `u`: unicode (`charset=self.UTF` override)       + `b`: blank (`charset="  "` override)+      + 't': train (`charset=self.TRAIN` override)     """     ASCII = " 123456789#"     UTF = " " + ''.join(map(chr, range(0x258F, 0x2587, -1)))     BLANK = "  "+    TRAIN = "ﲫ"     COLOUR_RESET = '\x1b[0m'     COLOUR_RGB = '\x1b[38;2;%d;%d;%dm'     COLOURS = {'BLACK': '\x1b[30m', 'RED': '\x1b[31m', 'GREEN': '\x1b[32m',@@ -157,6 +160,7 @@ class Bar:         self.default_len = default_len         self.charset = charset         self.colour = colour+        self.tree_locations = None      @property     def colour(self):@@ -184,7 +188,7 @@ class Bar:         if format_spec:             _type = format_spec[-1].lower()             try:-                charset = {'a': self.ASCII, 'u': self.UTF, 'b': self.BLANK}[_type]+                charset = {'a': self.ASCII, 'u': self.UTF, 'b': self.BLANK, 't': self.TRAIN}[_type]             except KeyError:                 charset = self.charset             else:@@ -202,9 +206,41 @@ class Bar:         nsyms = len(charset) - 1         bar_length, frac_bar_length = divmod(int(self.frac * N_BARS * nsyms), nsyms) -        res = charset[-1] * bar_length-        if bar_length < N_BARS:  # whitespace padding-            res = res + charset[frac_bar_length] + charset[0] * (N_BARS - bar_length - 1)+        if charset == self.TRAIN:+            rng = random.Random(1)+            self.tree_locations = (+                [rng.randint(0, N_BARS - 1) for _ in range(10)]+                if self.tree_locations is None+                else self.tree_locations+            )+            tree_locations = [+                (tree_location - bar_length) % N_BARS+                for tree_location in self.tree_locations+            ]+            tree_types = ""+            trees = rng.choices(tree_types, k=len(tree_locations))++            pre_tracks = list("‗" * max(bar_length - 10, 0))+            for j, i in enumerate(tree_locations):+                if i < len(pre_tracks):+                    pre_tracks[i] = trees[j]++            track_len = N_BARS - bar_length - 1+            post_tracks = list("‗" * (track_len))+            for j, i in enumerate(tree_locations):+                if N_BARS - i < len(post_tracks) + 1:+                    post_tracks[i - bar_length - 1] = trees[j]++            res = "".join(pre_tracks)+            if bar_length <= N_BARS:  # whitespace padding+                if bar_length == N_BARS:+                    res = res[:-1]+                res = res + "ﲫ" * min(bar_length, 10) + "" + "".join(post_tracks)+        else:+            res = charset[-1] * bar_length+            if bar_length < N_BARS:  # whitespace padding+                res = res + charset[frac_bar_length] + charset[0] * (N_BARS - bar_length - 1)+         return self.colour + res + self.COLOUR_RESET if self.colour else res

From data/bench/sync-real.json, run with scripts/bench-sync-real.ts on 2026-10-28. Every result on the results page, moved or stayed. Try your own fork.