Skip to content

Commit f6efae2

Browse files
committed
Preserve main routes and registry data after rebase
1 parent 9af3fcb commit f6efae2

12 files changed

Lines changed: 198 additions & 27 deletions

docs/quality-registries.toml

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,11 @@ kind = "example"
794794
value = "iterating-over-iterables"
795795
description = "separate value producers from value consumers"
796796

797+
[[journeys.sections.items]]
798+
kind = "example"
799+
value = "iterator-vs-iterable"
800+
description = "distinguish re-iterable collections from one-pass iterators"
801+
797802
[[journeys.sections.items]]
798803
kind = "example"
799804
value = "iterators"
@@ -1012,6 +1017,11 @@ kind = "example"
10121017
value = "properties"
10131018
description = "keep attribute syntax while adding computation or validation"
10141019

1020+
[[journeys.sections.items]]
1021+
kind = "example"
1022+
value = "classmethods-and-staticmethods"
1023+
description = "choose between instance, class, and static behavior on a class"
1024+
10151025
[[journeys.sections.items]]
10161026
kind = "example"
10171027
value = "special-methods"
@@ -1042,6 +1052,11 @@ kind = "example"
10421052
value = "attribute-access"
10431053
description = "customize fallback lookup and assignment carefully"
10441054

1055+
[[journeys.sections.items]]
1056+
kind = "example"
1057+
value = "bound-and-unbound-methods"
1058+
description = "explain how attribute access turns a function into a bound method"
1059+
10451060
[[journeys.sections.items]]
10461061
kind = "example"
10471062
value = "descriptors"
@@ -1071,6 +1086,11 @@ kind = "example"
10711086
value = "protocols"
10721087
description = "describe required behavior by structural shape"
10731088

1089+
[[journeys.sections.items]]
1090+
kind = "example"
1091+
value = "abstract-base-classes"
1092+
description = "contrast runtime-enforced nominal interfaces with structural protocols"
1093+
10741094
[[journeys.sections.items]]
10751095
kind = "example"
10761096
value = "enums"
@@ -1100,6 +1120,11 @@ kind = "example"
11001120
value = "typed-dicts"
11011121
description = "type dictionary records that come from JSON"
11021122

1123+
[[journeys.sections.items]]
1124+
kind = "example"
1125+
value = "structured-data-shapes"
1126+
description = "choose between dataclass, NamedTuple, and TypedDict for records"
1127+
11031128
[[journeys.sections.items]]
11041129
kind = "example"
11051130
value = "literal-and-final"
@@ -1334,6 +1359,12 @@ anchor = "cell-0"
13341359
figure = "aliasing-mutation"
13351360
caption = "Two names share one mutable list — appending through one name changes the object visible through both."
13361361

1362+
[[figure_attachments]]
1363+
slug = "mutability"
1364+
anchor = "cell-0"
1365+
figure = "tuple-no-mutation"
1366+
caption = "By contrast, a tuple is frozen — its contents cannot change in place, so aliasing carries no mutation hazard."
1367+
13371368
[[figure_attachments]]
13381369
slug = "variables"
13391370
anchor = "cell-0"
@@ -1466,6 +1497,12 @@ anchor = "cell-0"
14661497
figure = "positional-only-separator"
14671498
caption = "A bare `/` divides positional-only arguments from positional-or-keyword ones; callers cannot name `a` or `b`."
14681499

1500+
[[figure_attachments]]
1501+
slug = "positional-only-parameters"
1502+
anchor = "cell-0"
1503+
figure = "kw-only-separator"
1504+
caption = "In the same signature, the bare `*` works the other way: parameters after it, such as `clamp`, must be named at the call site."
1505+
14691506
[[figure_attachments]]
14701507
slug = "closures"
14711508
anchor = "cell-0"
@@ -1532,6 +1569,12 @@ anchor = "cell-0"
15321569
figure = "iter-protocol"
15331570
caption = "An iterable knows how to produce an iterator (via iter()); the iterator knows how to produce values (via next())."
15341571

1572+
[[figure_attachments]]
1573+
slug = "iterator-vs-iterable"
1574+
anchor = "cell-1"
1575+
figure = "iterator-unroll"
1576+
caption = "The iterator's caret only moves forward — after the first `list(stream)` drains it, nothing is left for the second."
1577+
15351578
[[figure_attachments]]
15361579
slug = "type-aliases"
15371580
anchor = "cell-0"
@@ -1658,6 +1701,12 @@ anchor = "cell-0"
16581701
figure = "metaclass-triangle"
16591702
caption = "A metaclass is the type of a class, just as a class is the type of its instances; type is the default metaclass."
16601703

1704+
[[figure_attachments]]
1705+
slug = "metaclasses"
1706+
anchor = "cell-0"
1707+
figure = "class-triangle"
1708+
caption = "The class makes instances — the same triangle one level down, with type as the default apex."
1709+
16611710
[[figure_attachments]]
16621711
slug = "modules"
16631712
anchor = "cell-0"
@@ -1732,10 +1781,16 @@ caption = "Sets are hash buckets without values; `x in s` averages O(1) regardle
17321781

17331782
[[figure_attachments]]
17341783
slug = "tuples"
1735-
anchor = "cell-0"
1784+
anchor = "cell-3"
17361785
figure = "tuple-frozen"
17371786
caption = "Tuples are ordered, immutable sequences; positions matter, contents do not change once constructed."
17381787

1788+
[[figure_attachments]]
1789+
slug = "tuples"
1790+
anchor = "cell-3"
1791+
figure = "list-append"
1792+
caption = "A list is the other intent: a variable number of similar items, growing in place with `.append`."
1793+
17391794
[[figure_attachments]]
17401795
slug = "values"
17411796
anchor = "cell-0"

public/prototyping/marginalia-gestalt.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ <h3>Mutability</h3>
148148
<p class="caption">Two names share one mutable list — appending through one name changes the object visible through both.</p>
149149
<p class="score score-high">9.5 · three-state small multiple of aliased mutation</p>
150150
</div>
151+
<div class="card">
152+
<p class="eyebrow">Data Model · 12</p>
153+
<h3>Mutability</h3>
154+
<svg viewBox="-14 -14 248 213" width="397" height="341" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"><text x="0" y="12" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="8" fill="rgba(82, 16, 0, 0.7)" text-anchor="start" letter-spacing="0.5">TUPLE — FROZEN</text><rect x="0" y="18" width="60" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="30.0" y="34.0" font-family="'Iowan Old Style', Charter, Georgia, serif" font-size="11" fill="#521000" text-anchor="middle" font-style="italic">first</text><rect x="0" y="48" width="60" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="30.0" y="64.0" font-family="'Iowan Old Style', Charter, Georgia, serif" font-size="11" fill="#521000" text-anchor="middle" font-style="italic">second</text><line x1="60" y1="30" x2="80.03839178306819" y2="42.331318020349656" stroke="#521000" stroke-width="1.0"/><polygon points="86,46 78.57091899120806,44.71596130712238 81.50586457492832,39.946674733576934" fill="#521000"/><line x1="60" y1="60" x2="79.83670230054477" y2="49.31869876124512" stroke="#521000" stroke-width="1.0"/><polygon points="86,46 81.16418180504282,51.784017841027215 78.50922279604673,46.85337968146303" fill="#521000"/><rect x="88" y="32" width="110" height="28" fill="rgba(82, 16, 0, 0.05)" stroke="#521000" stroke-width="1.0"/><text x="143.0" y="50.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">("python",)</text><text x="0" y="102" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="8" fill="rgba(82, 16, 0, 0.7)" text-anchor="start" letter-spacing="0.5">NO .APPEND</text><rect x="0" y="108" width="60" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="30.0" y="124.0" font-family="'Iowan Old Style', Charter, Georgia, serif" font-size="11" fill="#521000" text-anchor="middle" font-style="italic">first</text><rect x="0" y="138" width="60" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="30.0" y="154.0" font-family="'Iowan Old Style', Charter, Georgia, serif" font-size="11" fill="#521000" text-anchor="middle" font-style="italic">second</text><line x1="60" y1="120" x2="80.03839178306819" y2="132.33131802034967" stroke="#521000" stroke-width="1.0"/><polygon points="86,136 78.57091899120806,134.7159613071224 81.50586457492832,129.94667473357694" fill="#521000"/><line x1="60" y1="150" x2="79.83670230054477" y2="139.31869876124512" stroke="#521000" stroke-width="1.0"/><polygon points="86,136 81.16418180504282,141.7840178410272 78.50922279604673,136.85337968146303" fill="#521000"/><rect x="88" y="122" width="110" height="28" fill="rgba(82, 16, 0, 0.05)" stroke="#521000" stroke-width="1.0"/><text x="143.0" y="140.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">("python",)</text><text x="150" y="170" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="9" fill="rgba(82, 16, 0, 0.7)" text-anchor="middle">tuples raise AttributeError</text></svg>
155+
<p class="caption">By contrast, a tuple is frozen — its contents cannot change in place, so aliasing carries no mutation hazard.</p>
156+
<p class="score score-high">9.5 · three-state small multiple of aliased mutation</p>
157+
</div>
151158
<div class="card">
152159
<p class="eyebrow">Basics · 13</p>
153160
<h3>Object Lifecycle</h3>
@@ -239,6 +246,13 @@ <h3>Iterator vs Iterable</h3>
239246
<p class="caption">An iterable knows how to produce an iterator (via iter()); the iterator knows how to produce values (via next()).</p>
240247
<p class="score score-high">9.0 · the protocol exposed</p>
241248
</div>
249+
<div class="card">
250+
<p class="eyebrow">Iteration · 25</p>
251+
<h3>Iterator vs Iterable</h3>
252+
<svg viewBox="-14 -14 248 158" width="397" height="253" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"><rect x="20" y="8" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="32.0" y="24.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">a</text><rect x="44" y="8" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="56.0" y="24.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">b</text><rect x="68" y="8" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="80.0" y="24.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">c</text><rect x="92" y="8" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="104.0" y="24.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">d</text><polygon points="32,7 28,1 36,1" fill="#521000"/><text x="124" y="24" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="9" fill="rgba(82, 16, 0, 0.7)" text-anchor="start">next()</text><rect x="20" y="38" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="32.0" y="54.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">a</text><rect x="44" y="38" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="56.0" y="54.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">b</text><rect x="68" y="38" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="80.0" y="54.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">c</text><rect x="92" y="38" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="104.0" y="54.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">d</text><polygon points="56,37 52,31 60,31" fill="#521000"/><text x="124" y="54" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="9" fill="rgba(82, 16, 0, 0.7)" text-anchor="start">next()</text><rect x="20" y="68" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="32.0" y="84.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">a</text><rect x="44" y="68" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="56.0" y="84.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">b</text><rect x="68" y="68" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="80.0" y="84.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">c</text><rect x="92" y="68" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="104.0" y="84.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">d</text><polygon points="80,67 76,61 84,61" fill="#521000"/><text x="124" y="84" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="9" fill="rgba(82, 16, 0, 0.7)" text-anchor="start">next()</text><rect x="20" y="98" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="32.0" y="114.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">a</text><rect x="44" y="98" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="56.0" y="114.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">b</text><rect x="68" y="98" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="80.0" y="114.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">c</text><rect x="92" y="98" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="104.0" y="114.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">d</text><polygon points="104,97 100,91 108,91" fill="#FF4801"/><text x="124" y="114" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="9" fill="rgba(82, 16, 0, 0.7)" text-anchor="start">next() — last</text></svg>
253+
<p class="caption">The iterator's caret only moves forward — after the first `list(stream)` drains it, nothing is left for the second.</p>
254+
<p class="score score-high">9.0 · the protocol exposed</p>
255+
</div>
242256
<div class="card">
243257
<p class="eyebrow">Iteration · 26</p>
244258
<h3>Sentinel Iteration</h3>
@@ -288,6 +302,13 @@ <h3>Tuples</h3>
288302
<p class="caption">Tuples are ordered, immutable sequences; positions matter, contents do not change once constructed.</p>
289303
<p class="score score-high">9.0 · frozen sequence with struck-through .append</p>
290304
</div>
305+
<div class="card">
306+
<p class="eyebrow">Collections · 31</p>
307+
<h3>Tuples</h3>
308+
<svg viewBox="-14 -14 248 64" width="397" height="102" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="8" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="12.0" y="24.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">3</text><rect x="24" y="8" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="36.0" y="24.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">1</text><rect x="48" y="8" width="24" height="24" fill="none" stroke="#521000" stroke-width="1.0"/><text x="60.0" y="24.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">4</text><rect x="72" y="8" width="24" height="24" fill="none" stroke="#521000" stroke-width="0.5" opacity="0.4"/><text x="84.0" y="24.0" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">+1</text><line x1="98" y1="20" x2="125.0" y2="20.0" stroke="#FF4801" stroke-width="1.4"/><polygon points="132,20 125.0,22.8 125.0,17.2" fill="#FF4801"/><text x="136" y="18" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="9" fill="rgba(82, 16, 0, 0.7)" text-anchor="start">.append</text></svg>
309+
<p class="caption">A list is the other intent: a variable number of similar items, growing in place with `.append`.</p>
310+
<p class="score score-high">9.0 · frozen sequence with struck-through .append</p>
311+
</div>
291312
<div class="card">
292313
<p class="eyebrow">Collections · 32</p>
293314
<h3>Unpacking</h3>
@@ -372,6 +393,13 @@ <h3>Positional-only Parameters</h3>
372393
<p class="caption">A bare `/` divides positional-only arguments from positional-or-keyword ones; callers cannot name `a` or `b`.</p>
373394
<p class="score score-high">9.0 · signature with explicit `/` separator</p>
374395
</div>
396+
<div class="card">
397+
<p class="eyebrow">Functions · 43</p>
398+
<h3>Positional-only Parameters</h3>
399+
<svg viewBox="-14 -14 228 84" width="365" height="134" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"><text x="0" y="18" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="start">def f(a, b, *, c, d): …</text><line x1="75.0" y1="22" x2="75.0" y2="38" stroke="#521000" stroke-width="0.6" stroke-dasharray="2 2"/><text x="33" y="50" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="9" fill="rgba(82, 16, 0, 0.7)" text-anchor="middle">positional or kw</text><text x="120" y="50" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="9" fill="rgba(82, 16, 0, 0.7)" text-anchor="middle">keyword only</text></svg>
400+
<p class="caption">In the same signature, the bare `*` works the other way: parameters after it, such as `clamp`, must be named at the call site.</p>
401+
<p class="score score-high">9.0 · signature with explicit `/` separator</p>
402+
</div>
375403
<div class="card">
376404
<p class="eyebrow">Functions · 44</p>
377405
<h3>Args and Kwargs</h3>
@@ -554,6 +582,13 @@ <h3>Metaclasses</h3>
554582
<p class="caption">A metaclass is the type of a class, just as a class is the type of its instances; type is the default metaclass.</p>
555583
<p class="score score-high">9.0 · extended triangle to metaclass</p>
556584
</div>
585+
<div class="card">
586+
<p class="eyebrow">Classes · 69</p>
587+
<h3>Metaclasses</h3>
588+
<svg viewBox="-14 -14 302 88" width="483" height="141" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="28" r="2.5" fill="#521000"/><text x="20" y="54" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="9" fill="rgba(82, 16, 0, 0.7)" text-anchor="middle">instance</text><line x1="26" y1="28" x2="79.0" y2="28.0" stroke="#521000" stroke-width="1.0"/><polygon points="86,28 79.0,30.8 79.0,25.2" fill="#521000"/><rect x="88" y="10" width="60" height="36" fill="none" stroke="#521000" stroke-width="1.0"/><text x="94" y="7" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="8" fill="rgba(82, 16, 0, 0.7)" text-anchor="start" letter-spacing="0.5">CLASS</text><text x="118" y="32" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">Class</text><line x1="148" y1="28" x2="201.0" y2="28.0" stroke="#521000" stroke-width="1.0"/><polygon points="208,28 201.0,30.8 201.0,25.2" fill="#521000"/><rect x="210" y="10" width="60" height="36" fill="none" stroke="#521000" stroke-width="1.0"/><text x="216" y="7" font-family="-apple-system, 'Source Sans Pro', sans-serif" font-size="8" fill="rgba(82, 16, 0, 0.7)" text-anchor="start" letter-spacing="0.5">TYPE</text><text x="240.0" y="32" font-family="'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace" font-size="10" fill="#521000" text-anchor="middle">type</text></svg>
589+
<p class="caption">The class makes instances — the same triangle one level down, with type as the default apex.</p>
590+
<p class="score score-high">9.0 · extended triangle to metaclass</p>
591+
</div>
557592
<div class="card">
558593
<p class="eyebrow">Data Model · 70</p>
559594
<h3>Context Managers</h3>

public/prototyping/production-figures-gestalt.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-index.332712b2e502.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

public/search-index.f08e8599474a.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/search-index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)