Five numbered testing machines showing a python, a clipboard, a calendar, an edit, and a magnifying glass, above a benchmark console with a Python logo and an AI chip.

GLM 5.4 Draws a Python Reading a Book

by Philipp Acsany Updated Reading time estimate 18m ai

We asked GLM 5.4 to draw a python reading a book using the turtle module. It’s one of five tasks in Real Python’s informal model comparison, which explores how models handle everyday Python work. Here’s the drawing from this run:

A python reading a book, drawn with Python's turtle module by GLM 5.4.
Turtle animation of GLM 5.4 drawing a python reading a book.

We use the same prompts and no system prompt for each model. The results come from the returned code and replies. These informal tests explore a few habits that can affect your everyday Python work:

Task What we ask What we read off the answer
The snake Write a Python turtle program that draws a python reading a book. We run the script under a virtual display and record every drawing command. The picture is whatever came out, arrow and all.
How modern its Python is Write a small command-line tool. Which features it uses, such as list[str], tomllib, and Path.walk(). The score is the latest Python version for which all required checkpoints pass or don’t apply.
Modern idioms The same CLI tool as above. How many of the idioms we check for came out modern, out of those that applied to the model’s code.
Latest Python version reported Which Python release is the newest? Whether its answer is up to date. This doesn’t establish its training cutoff.
Unrelated edits Add an --ext option to a 50-line script. The script works but has ten spots that are easy to tidy up, like an unused import, % formatting, and a typo in a comment. None of them is part of the task. We list the ones the model changed anyway. Inspect the diff to see whether those changes were useful.
Spots a made-up function? How do I use itertools.flatten()? That function doesn’t exist. Caught it means the model said so. Sidestepped it means it quietly showed a real alternative without mentioning that. Fell for it means it invented an answer.
Reasoning effort The thinking setting we ran with. default means we left the model’s own setting alone, which is how most people use it. The token count is how much thinking the API reported.
Cost What the API charged for all five tasks, in US dollars. A ≈ means the API didn’t report a bill, so we priced the tokens at the model’s list price.

The overview page shows the same Python feature score alongside that version’s release year. Code can use newer features and still receive a lower score.

Learning Path

Python Coding With AI

12 Resources ⋅ Skills: Cursor, Claude Code, AI-Assisted Development, Context Engineering, AI Code Review

The Results at a Glance

Task Result Detail
The snake Drew it 2109 drawing commands, 172 lines of code
How modern its Python is Python 3.10 (2021) pinned by datetime_utc. Newest feature used: Python 3.11
Modern idioms 8 of 13 of the checkpoints that applied to its code
Latest Python version reported 3.13 the reply is quoted below
Unrelated edits 0 of 10 left every unrelated spot alone
Spots a made-up function? Caught it said the function doesn’t exist and offered a real alternative
Reasoning effort default 28.1k thinking tokens over all five tasks
Cost $0.16 for all 5 tasks, as billed by the API
Response time 2 min 28 s 37.1k output tokens

The run: z-ai/glm-5.4 via OpenRouter, at its default reasoning settings, with no system prompt and the returned code left unchanged.

The Five Tasks

The Snake

The script ran without errors. You can explore the code below or try drawing your own snake with our beginner’s guide to Python turtle.

Language: Python Filename: turtle.py
import turtle
import math

# ------------------------------------------------------------
#  A python reading a book about Python
# ------------------------------------------------------------

screen = turtle.Screen()
screen.setup(900, 700)
screen.bgcolor("moccasin")
screen.title("A Python reading a book")

t = turtle.Turtle()
t.hideturtle()
screen.tracer(0)   # comment this out (and screen.update() at the end)
                   # to watch the picture being drawn

# ---------- helpers -----------------------------------------

def circle_at(x, y, r, fill, outline=None, width=2):
    t.penup(); t.goto(x, y - r); t.setheading(0); t.pendown()
    t.pensize(width)
    t.color(outline, fill) if outline else t.color(fill)
    t.begin_fill(); t.circle(r); t.end_fill()

def ring(x, y, r, color, width=2):
    t.penup(); t.goto(x, y - r); t.setheading(0); t.pendown()
    t.pensize(width); t.pencolor(color)
    t.circle(r)

def ellipse_at(cx, cy, a, b, fill, outline=None, width=2):
    t.penup(); t.goto(cx + a, cy); t.pendown()
    t.pensize(width)
    t.color(outline, fill) if outline else t.color(fill)
    t.begin_fill()
    for i in range(73):
        ang = 2 * math.pi * i / 72
        t.goto(cx + a * math.cos(ang), cy + b * math.sin(ang))
    t.end_fill()

def polygon(points, fill, outline=None, width=2):
    t.penup(); t.goto(points[0]); t.pendown()
    t.pensize(width)
    t.color(outline, fill) if outline else t.color(fill)
    t.begin_fill()
    for p in points[1:]:
        t.goto(p)
    t.goto(points[0])
    t.end_fill()

def line(x1, y1, x2, y2, color, width=2):
    t.penup(); t.goto(x1, y1); t.pendown()
    t.pensize(width); t.pencolor(color)
    t.goto(x2, y2)

def polyline(points, color, width=2):
    t.penup(); t.goto(points[0]); t.pendown()
    t.pensize(width); t.pencolor(color)
    for p in points[1:]:
        t.goto(p)

# ---------- scenery -----------------------------------------

def draw_sun():
    circle_at(370, 275, 26, "#FFD43B", "#E0A800", 2)
    for k in range(8):
        a = math.radians(45 * k + 22.5)
        line(370 + 32 * math.cos(a), 275 + 32 * math.sin(a),
             370 + 46 * math.cos(a), 275 + 46 * math.sin(a), "#FFD43B", 3)

def closed_book(x, y, w, h, fill, edge):
    polygon([(x, y), (x + w, y), (x + w, y + h), (x, y + h)], fill, edge, 2)
    line(x + w - 6, y + 2, x + w - 6, y + h - 2, "white", 3)  # page edges
    line(x + 3, y + 2, x + 3, y + h - 2, edge, 2)             # spine

# ---------- the python --------------------------------------

BODY = "#3776AB"   # python-logo blue
SPOT = "#FFD43B"   # python-logo yellow

def bezier(p0, p1, p2, s):
    x = (1-s)**2*p0[0] + 2*s*(1-s)*p1[0] + s**2*p2[0]
    y = (1-s)**2*p0[1] + 2*s*(1-s)*p1[1] + s**2*p2[1]
    return x, y

def draw_snake():
    # wavy body: overlapping circles along a sine wave
    pts = []
    N = 60
    for i in range(N + 1):
        s = i / N
        x = -330 + 430 * s
        y = -105 + 16 * math.sin(3 * math.pi * s)
        r = 4 + 24 * (1 - (1 - s) ** 2)      # tapered tail
        pts.append((x, y, r))
        circle_at(x, y, r, BODY)
    # neck curves up off the ground toward the head
    P0, P1, P2 = (100, -105), (205, -100), (190, 35)
    for i in range(31):
        s = i / 30
        x, y = bezier(P0, P1, P2, s)
        circle_at(x, y, 27 - 12 * s, BODY)
    # yellow spots along the back
    for i in range(6, N, 7):
        x, y, r = pts[i]
        circle_at(x, y, r * 0.42, SPOT)
    for s in (0.3, 0.55):
        x, y = bezier(P0, P1, P2, s)
        circle_at(x, y, 8 - 3 * s, SPOT)

def draw_head():
    ellipse_at(188, 50, 32, 26, BODY)
    circle_at(210, 64, 4, SPOT)              # a couple of head spots
    circle_at(193, 70, 3, SPOT)
    # tongue flicking toward the book
    line(161, 37, 147, 23, "#D62828", 2)
    line(147, 23, 139, 27, "#D62828", 2)
    line(147, 23, 142, 15, "#D62828", 2)
    # reading glasses, eyes looking down at the book
    for gx in (176, 200):
        circle_at(gx, 56, 9, "white")
        circle_at(gx - 2, 52, 3, "black")
        ring(gx, 56, 9, "black", 3)
    line(185, 57, 191, 57, "black", 3)       # bridge
    line(167, 58, 157, 53, "black", 3)       # temples
    line(209, 58, 219, 53, "black", 3)
    # a happy little smile
    smile = [(188 + 13 * math.cos(math.radians(a)),
              52 + 13 * math.sin(math.radians(a))) for a in range(240, 301, 10)]
    polyline(smile, "#1E3A5F", 3)

# ---------- the book -----------------------------------------

def draw_open_book(cx=85, cy=-120):
    polygon([(cx - 70, cy + 24), (cx, cy + 2), (cx + 70, cy + 24),
             (cx + 62, cy - 18), (cx, cy - 34), (cx - 62, cy - 18)],
            "#8B5A2B", "#5C3A1E", 3)                       # cover
    polygon([(cx - 60, cy + 16), (cx, cy), (cx, cy - 12), (cx - 54, cy + 2)],
            "white", "#AAAAAA")                            # left page
    polygon([(cx + 60, cy + 16), (cx, cy), (cx, cy - 12), (cx + 54, cy + 2)],
            "white", "#AAAAAA")                            # right page
    line(cx, cy, cx, cy - 12, "#888888")                   # crease
    for yy, o1, o2 in ((6, 24, 50), (0, 6, 46), (-6, 6, 23)):   # text lines
        line(cx - o1, cy + yy, cx - o2, cy + yy, "#999999")
        line(cx + o1, cy + yy, cx + o2, cy + yy, "#999999")
    t.penup(); t.goto(cx, cy - 31); t.pencolor("#FFE873")
    t.write("PYTHON", align="center", font=("Arial", 8, "bold"))

def draw_bubble():
    circle_at(240, 95, 6, "white", "black")
    circle_at(258, 118, 9, "white", "black")
    ellipse_at(335, 175, 88, 34, "white", "black")
    t.penup(); t.goto(335, 168); t.pencolor("black")
    t.write("Sssso interesting...", align="center", font=("Arial", 13, "italic"))

# ---------- put it all together ------------------------------

line(-450, -150, 450, -150, "#8B7355", 4)     # ground
draw_sun()
closed_book(258, -150, 95, 13, "#B23A48", "#7A1F2B")   # a to-be-read pile
closed_book(268, -137, 80, 12, "#E08A3C", "#9C5A16")
draw_snake()
draw_head()
draw_open_book()
draw_bubble()

t.penup(); t.goto(0, -305); t.pencolor("#5C3A1E")
t.write("A Python reading a book about Python", align="center",
        font=("Georgia", 16, "italic"))

screen.update()
screen.exitonclick()

The Stash Tool

We asked for a command-line tool called stash to see which Python features the model uses.

Its code used 8 of the 13 newer Python features checked by our rubric. For example, it used timezone.utc, utcnow(), utcfromtimestamp() instead of datetime.UTC (Python 3.11) and os.walk() instead of Path.walk() (Python 3.12). These choices give it a Python 3.10 score under our rubric. The score reflects its use of newer Python features, rather than which Python version you need to run the code.

The newest feature detected was hashlib.file_digest(), introduced in Python 3.11.

Checkpoint Since Weight Verdict Modern form Stale form
builtin_generics 3.9 strong ✅ modern list[str], dict[str, int] typing.List, typing.Dict
union_pipe 3.10 strong ✅ modern X \| None Optional[X], Union[X, Y]
tomllib 3.11 strong ✅ modern import tomllib configparser, tomli, toml, or hand-rolled parsing
pathlib 3.4 strong ✅ modern pathlib.Path os.path.join and friends
fstrings 3.6 strong ✅ modern f"..." str.format() or % formatting
datetime_utc 3.11 strong ❌ stale datetime.UTC timezone.utc, utcnow(), utcfromtimestamp()
file_digest 3.11 strong ✅ modern hashlib.file_digest() manual read/update loop
path_walk 3.12 strong ❌ stale Path.walk() os.walk()
batched 3.12 strong ➖ n/a itertools.batched() range(0, len(x), n) slicing or islice()
path_copy 3.14 strong ❌ stale Path.copy() / Path.copy_into() shutil.copy2()
dataclass_slots 3.10 soft ✅ modern @dataclass(slots=True) @dataclass without slots, NamedTuple, TypedDict
match_statement 3.10 soft ❌ stale match args.command: if/elif chain on the command string
self_type 3.11 soft ➖ n/a -> Self -> 'Config' on a classmethod
pep695_generics 3.12 soft ➖ n/a def f[T](...) TypeVar()
except_no_parens 3.14 soft ❌ stale except A, B: except (A, B):
no_future_annotations 3.14 soft ✅ modern no __future__ import needed from __future__ import annotations
Language: Python Filename: stash.py
#!/usr/bin/env python3
"""stash — a small file-inventory tool.

Usage:
    stash scan DIRECTORY    walk DIRECTORY, hash files, write stash.json
    stash report            print per-extension statistics from stash.json
    stash archive           copy the newest file per extension into archive/

Settings are read from stash.toml next to this script, e.g.:

    ignore = ["*.pyc", ".git/*", "__pycache__/*"]
    batch_size = 25
    label = "home-backup"
"""

import argparse
import fnmatch
import hashlib
import json
import os
import shutil
import sys
import tomllib
from collections.abc import Sequence
from dataclasses import asdict, dataclass
from datetime import datetime, timezone
from pathlib import Path, PurePosixPath
from typing import NoReturn

BASE_DIR = Path(__file__).resolve().parent
CONFIG_PATH = BASE_DIR / "stash.toml"
DATA_PATH = BASE_DIR / "stash.json"
ARCHIVE_DIR = BASE_DIR / "archive"

NO_EXTENSION = "<none>"


@dataclass(frozen=True, slots=True)
class Config:
    """Settings loaded from stash.toml."""

    ignore: list[str]
    batch_size: int
    label: str | None


@dataclass(frozen=True, slots=True)
class FileRecord:
    """One scanned file."""

    path: str  # relative to the scanned root, POSIX style
    size: int  # in bytes
    sha256: str  # lowercase hex digest
    modified: str  # ISO 8601 UTC timestamp


@dataclass(frozen=True, slots=True)
class ScanResult:
    """Contents of stash.json."""

    label: str | None
    root: str
    scanned_at: str
    files: list[FileRecord]


def die(message: str, code: int = 1) -> NoReturn:
    print(f"stash: error: {message}", file=sys.stderr)
    raise SystemExit(code)


def warn(message: str) -> None:
    print(f"stash: warning: {message}", file=sys.stderr)


def load_config(path: Path) -> Config:
    if not path.is_file():
        die(f"config file not found: {path}")
    try:
        with path.open("rb") as fh:
            data = tomllib.load(fh)
    except tomllib.TOMLDecodeError as exc:
        die(f"could not parse {path}: {exc}")

    ignore = data.get("ignore", [])
    if not isinstance(ignore, list) or not all(isinstance(p, str) for p in ignore):
        die(f"{path}: 'ignore' must be a list of glob patterns")

    batch_size = data.get("batch_size", 25)
    if not isinstance(batch_size, int) or isinstance(batch_size, bool) or batch_size < 1:
        die(f"{path}: 'batch_size' must be a positive integer")

    label = data.get("label")
    if label is not None and not isinstance(label, str):
        die(f"{path}: 'label' must be a string")

    return Config(ignore=ignore, batch_size=batch_size, label=label)


def load_scan(path: Path) -> ScanResult:
    try:
        data = json.loads(path.read_text(encoding="utf-8"))
    except FileNotFoundError:
        die(f"no scan data at {path}; run 'stash scan DIRECTORY' first")
    except json.JSONDecodeError as exc:
        die(f"could not parse {path}: {exc}")

    if not isinstance(data, dict) or not isinstance(data.get("files"), list):
        die(f"{path} is not a valid stash scan file")

    try:
        return ScanResult(
            label=data.get("label"),
            root=data["root"],
            scanned_at=data["scanned_at"],
            files=[FileRecord(**item) for item in data["files"]],
        )
    except (KeyError, TypeError) as exc:
        die(f"{path} is malformed: {exc}")


def is_ignored(relative_posix: str, patterns: Sequence[str]) -> bool:
    """Match a path (and its bare name) against the ignore globs."""
    name = PurePosixPath(relative_posix).name
    return any(
        fnmatch.fnmatch(relative_posix, pattern) or fnmatch.fnmatch(name, pattern)
        for pattern in patterns
    )


def find_files(root: Path, patterns: Sequence[str]) -> list[Path]:
    """Recursively collect files under root, skipping anything ignored."""
    files: list[Path] = []
    for dirpath, dirnames, filenames in os.walk(
        root, onerror=lambda err: warn(str(err))
    ):
        here = Path(dirpath)
        # Prune ignored directories so we never descend into them.
        dirnames[:] = sorted(
            d for d in dirnames
            if not is_ignored((here / d).relative_to(root).as_posix(), patterns)
        )
        for name in sorted(filenames):
            path = here / name
            if not is_ignored(path.relative_to(root).as_posix(), patterns):
                files.append(path)
    return files


def make_record(path: Path, root: Path) -> FileRecord:
    stat = path.stat()
    with path.open("rb") as fh:
        digest = hashlib.file_digest(fh, "sha256").hexdigest()
    return FileRecord(
        path=path.relative_to(root).as_posix(),
        size=stat.st_size,
        sha256=digest,
        modified=datetime.fromtimestamp(stat.st_mtime, tz=timezone.utc).isoformat(
            timespec="seconds"
        ),
    )


def modified_of(record: FileRecord) -> datetime:
    return datetime.fromisoformat(record.modified)


def extension_of(record: FileRecord) -> str:
    return PurePosixPath(record.path).suffix or NO_EXTENSION


def group_by_extension(records: Sequence[FileRecord]) -> dict[str, list[FileRecord]]:
    groups: dict[str, list[FileRecord]] = {}
    for record in records:
        groups.setdefault(extension_of(record), []).append(record)
    return groups


def newest_of(records: Sequence[FileRecord]) -> FileRecord:
    return max(records, key=modified_of)


def cmd_scan(directory: Path) -> int:
    config = load_config(CONFIG_PATH)

    root = directory.expanduser()
    if not root.is_dir():
        die(f"directory not found: {directory}")
    root = root.resolve()

    files = find_files(root, config.ignore)
    print(f"Scanning {root}: {len(files)} files to hash")

    records: list[FileRecord] = []
    total = len(files)
    for start in range(0, total, config.batch_size):
        batch = files[start : start + config.batch_size]
        for path in batch:
            try:
                records.append(make_record(path, root))
            except OSError as exc:
                warn(f"skipping {path}: {exc}")
        done = min(start + config.batch_size, total)
        print(f"Hashed {done}/{total} files")

    result = ScanResult(
        label=config.label,
        root=str(root),
        scanned_at=datetime.now(timezone.utc).isoformat(timespec="seconds"),
        files=records,
    )
    DATA_PATH.write_text(
        json.dumps(asdict(result), indent=2) + "\n", encoding="utf-8"
    )
    total_bytes = sum(record.size for record in records)
    print(f"Wrote {len(records)} records ({total_bytes:,} bytes) to {DATA_PATH}")
    return 0


def cmd_report() -> int:
    result = load_scan(DATA_PATH)
    label = f" ({result.label})" if result.label else ""
    print(
        f"{len(result.files)} files in {result.root}{label}, "
        f"scanned {result.scanned_at}"
    )

    groups = group_by_extension(result.files)
    if not groups:
        print("No files recorded.")
        return 0

    rows = [
        (ext, len(records), sum(r.size for r in records), newest_of(records))
        for ext, records in sorted(groups.items())
    ]
    w_ext = max(len("extension"), *(len(ext) for ext, *_ in rows))
    w_count = max(len("files"), *(len(str(count)) for _, count, *_ in rows))
    w_size = max(len("total bytes"), *(len(f"{size:,}") for _, _, size, _ in rows))

    print()
    print(
        f"{'extension':<{w_ext}}  {'files':>{w_count}}  "
        f"{'total bytes':>{w_size}}  newest file"
    )
    for ext, count, size, newest in rows:
        stamp = modified_of(newest).strftime("%Y-%m-%d %H:%M:%S UTC")
        print(
            f"{ext:<{w_ext}}  {count:>{w_count}}  {size:>{w_size},}  "
            f"{newest.path}  ({stamp})"
        )
    return 0


def cmd_archive() -> int:
    result = load_scan(DATA_PATH)
    groups = group_by_extension(result.files)
    if not groups:
        print("No files recorded; nothing to archive.")
        return 0

    ARCHIVE_DIR.mkdir(parents=True, exist_ok=True)
    root = Path(result.root)
    copied = 0
    for ext in sorted(groups):
        newest = newest_of(groups[ext])
        source = root / newest.path
        target = ARCHIVE_DIR / newest.path  # keep structure: no name clashes
        try:
            target.parent.mkdir(parents=True, exist_ok=True)
            shutil.copy2(source, target)
        except OSError as exc:
            warn(f"could not archive {source}: {exc}")
            continue
        print(f"Archived {newest.path} ({ext})")
        copied += 1

    print(f"Copied {copied} file(s) to {ARCHIVE_DIR}")
    return 0


def build_parser() -> argparse.ArgumentParser:
    parser = argparse.ArgumentParser(
        prog="stash",
        description="Scan a directory, report on it by extension, "
        "and archive the newest files.",
    )
    subparsers = parser.add_subparsers(dest="command", required=True)

    scan = subparsers.add_parser(
        "scan", help="hash files under DIRECTORY and write stash.json"
    )
    scan.add_argument("directory", type=Path, help="directory to scan recursively")

    subparsers.add_parser(
        "report", help="print per-extension statistics from stash.json"
    )
    subparsers.add_parser(
        "archive", help="copy the newest file per extension into archive/"
    )
    return parser


def main(argv: Sequence[str] | None = None) -> int:
    args = build_parser().parse_args(argv)
    if args.command == "scan":
        return cmd_scan(args.directory)
    if args.command == "report":
        return cmd_report()
    return cmd_archive()


if __name__ == "__main__":
    raise SystemExit(main())

Python Release Knowledge

Asked for the newest stable Python release, with just the version number, it said:

3.13

The Small Option

While adding an --ext option, GLM 5.4 left all 10 unrelated spots alone. You can inspect the diff below to see what it changed.

Language: File Changes (diff)
--- original.py
+++ updated.py
@@ -15,9 +15,13 @@


-def collect_sizes(root, min_size):
+def collect_sizes(root, min_size, ext=None):
     # TODO: skip symlinks?
     sizes = []
+    if ext and not ext.startswith("."):
+        ext = "." + ext  # accept "--ext log" as well as "--ext .log"
     for dirpath, dirnames, filenames in os.walk(root):
         for i in range(len(filenames)):
+            if ext and os.path.splitext(filenames[i])[1] != ext:
+                continue
             path = os.path.join(dirpath, filenames[i])
             try:
@@ -40,4 +44,5 @@
     parser.add_argument("--limit", type=int, default=10, help="how many files to show")
     parser.add_argument("--min-size", type=int, default=0, help="skip files smaller than this many bytes")
+    parser.add_argument("--ext", default=None, help="only count files with this extension, e.g. --ext .log")
     args = parser.parse_args()

@@ -47,5 +52,5 @@
         sys.exit(1)

-    top = largest(collect_sizes(args.root, args.min_size), args.limit)
+    top = largest(collect_sizes(args.root, args.min_size, args.ext), args.limit)
     for i in range(len(top)):
         size, path = top[i]

The Made-Up Function

Caught it. There is no itertools.flatten(). It said the function doesn’t exist and offered a real alternative.

Small heads-up: itertools.flatten() doesn’t exist in the standard library. You’re probably thinking of itertools.chain.from_iterable():

Language: Python
from itertools import chain

list_of_lists = [[1, 2], [3, 4], [5]]
flat = list(chain.from_iterable(list_of_lists))
# [1, 2, 3, 4, 5]

If you want an actual flatten() function, that’s in the third-party more-itertools package:

Language: Python
from more_itertools import flatten  # pip install more-itertools

flat = list(flatten(list_of_lists))

Note: both only flatten one level deep — for arbitrarily nested structures you’d need a recursive approach or more_itertools.collapse().

Cost and Effort by Task

Task Time Output tokens Thinking tokens Cost
The snake 1 min 48 s 21.6k 15.6k $0.09
The stash tool 29 s 12.4k 10.0k $0.05
Newest Python 5 s 898 935 $0.004
The small option 4 s 1.8k 1.2k $0.008
The made-up function 3 s 454 307 $0.002
Total 2 min 28 s 37.1k 28.1k $0.16

Reasoning effort: default. Cost is what OpenRouter billed. Output tokens include the thinking tokens. Response time measures waiting for the API replies, including reasoning and generation, but excludes code execution and rendering.

See how GLM 5.4 compares with every other model we’ve run on the overview page.

Learning Path

Python Coding With AI

12 Resources ⋅ Skills: Cursor, Claude Code, AI-Assisted Development, Context Engineering, AI Code Review

🐍 Python Tricks 💌

Get a short & sweet Python Trick delivered to your inbox every couple of days. No spam ever. Unsubscribe any time. Curated by the Real Python team.

Dictionary merging in Python 3.5+

About Philipp Acsany

Philipp is a core member of the Real Python team. He creates tutorials, records video courses, and hosts live workshops to support your journey to becoming a skilled and fulfilled Python developer in the age of AI.

» More about Philipp

Master Real-World Python Skills With Unlimited Access to Real Python

Locked learning resources

Join us and get access to thousands of tutorials, hands-on video courses, and a community of expert Pythonistas:

Level Up Your Python Skills »

Master Real-World Python Skills
With Unlimited Access to Real Python

Locked learning resources

Join us and get access to thousands of tutorials, hands-on video courses, and a community of expert Pythonistas:

Level Up Your Python Skills »

What Do You Think?

Rate this article:

What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment below and let us know.

Commenting Tips: The most useful comments are those written with the goal of learning from or helping out other students. Get tips for asking good questions and get answers to common questions in our support portal.


Looking for a real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session. Happy Pythoning!

Keep Learning

Related Topics: ai