Skip to content

Commit cc3ebbb

Browse files
committed
chore: copy updates
1 parent 2d871a4 commit cc3ebbb

5 files changed

Lines changed: 33 additions & 28 deletions

File tree

copydecks/en/copydeck.json

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"If an inner function needs it, pass the value in as an argument instead of relying on the enclosing scope."
4747
],
4848
"_placeholders": {
49-
"name": "The enclosing-scope variable name, e.g. total",
50-
"loc": "Where it was used, e.g. line 3 in main.py"
49+
"name": "The enclosing-scope variable name, eg. total",
50+
"loc": "Where it was used, eg. line 3 in main.py"
5151
}
5252
},
5353
{
@@ -63,8 +63,8 @@
6363
"Check spelling and capital letters."
6464
],
6565
"_placeholders": {
66-
"name": "The undefined variable name, e.g. kittens",
67-
"loc": "Where it was used, e.g. line 2 in main.py"
66+
"name": "The undefined variable name, eg. kittens",
67+
"loc": "Where it was used, eg. line 2 in main.py"
6868
}
6969
}
7070
]
@@ -80,8 +80,8 @@
8080
"Give it a value first (add a line like {{name}} = ... before you use it)."
8181
],
8282
"_placeholders": {
83-
"name": "The variable used before assignment, e.g. score",
84-
"loc": "Where it was read before being set, e.g. line 4 in main.py"
83+
"name": "The variable used before assignment, eg. score",
84+
"loc": "Where it was read before being set, eg. line 4 in main.py"
8585
}
8686
}
8787
]
@@ -101,8 +101,8 @@
101101
"Add a colon (:) at the end of that line."
102102
],
103103
"_placeholders": {
104-
"loc": "Where the missing colon is, e.g. line 3 in main.py",
105-
"codeLine": "The line that needs the colon, e.g. for i in range(10)"
104+
"loc": "Where the missing colon is, eg. line 3 in main.py",
105+
"codeLine": "The line that needs the colon, eg. for i in range(10)"
106106
}
107107
},
108108
{
@@ -116,8 +116,8 @@
116116
"Replace the comma with a colon (:)."
117117
],
118118
"_placeholders": {
119-
"loc": "Where the comma is, e.g. line 1 in main.py",
120-
"codeLine": "The line ending with a comma, e.g. if score > 10,"
119+
"loc": "Where the comma is, eg. line 1 in main.py",
120+
"codeLine": "The line ending with a comma, eg. if score > 10,"
121121
}
122122
},
123123
{
@@ -131,8 +131,8 @@
131131
"Leave only one colon (:) at the end of the line."
132132
],
133133
"_placeholders": {
134-
"loc": "Where the extra colon is, e.g. line 2 in main.py",
135-
"codeLine": "The line with double colons, e.g. if x > 0::"
134+
"loc": "Where the extra colon is, eg. line 2 in main.py",
135+
"codeLine": "The line with double colons, eg. if x > 0::"
136136
}
137137
},
138138
{
@@ -200,8 +200,8 @@
200200
"Keep = for setting a variable value outside comparisons."
201201
],
202202
"_placeholders": {
203-
"loc": "Where the = is used in a condition, e.g. line 6 in main.py",
204-
"codeLine": "The condition line, e.g. if score = 10:"
203+
"loc": "Where the = is used in a condition, eg. line 6 in main.py",
204+
"codeLine": "The condition line, eg. if score = 10:"
205205
}
206206
},
207207
{
@@ -240,7 +240,7 @@
240240
"Line up all lines in the block."
241241
],
242242
"_placeholders": {
243-
"loc": "Where the indentation problem is, e.g. line 7 in main.py"
243+
"loc": "Where the indentation problem is, eg. line 7 in main.py"
244244
}
245245
}
246246
]
@@ -276,13 +276,18 @@
276276
]
277277
},
278278
{
279-
"title": "This thing doesn't have that name after the dot",
280-
"summary": "The thing you're using doesn't have that attribute or method.",
281-
"why": "That kind of thing doesn't provide this feature.",
279+
"title": "That name after the dot isn't available for this value",
280+
"summary": "At {{loc}}, {{codeLine}} uses a name after the dot that this kind of value doesn't have. It might be a typo, or a method that belongs to a different type of value.",
281+
"why": "After a dot, Python looks for a method or property that belongs to that exact kind of value - a string, a list, a number, and so on. If that kind of value has nothing by that name, you get this error.",
282282
"steps": [
283-
"Check the spelling after the dot.",
284-
"Use a name that exists for this kind of thing."
285-
]
283+
"Check the spelling and capital letters of the name after the dot.",
284+
"Make sure the value is the kind you expect - for example a list has .append(), but a string does not.",
285+
"Look up which methods that kind of value supports, and use one of those."
286+
],
287+
"_placeholders": {
288+
"loc": "Where the attribute was used, eg. line 2 in main.py",
289+
"codeLine": "The line with the dotted access, eg. name.shrink()"
290+
}
286291
}
287292
]
288293
},

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The demo shows how the library transforms common Python error traces (from both
1010

1111
- **NameError**: Undefined variables
1212
- **SyntaxError**: Missing colons and syntax issues
13-
- **AttributeError**: Wrong method names (e.g., `.push()` instead of `.append()`)
13+
- **AttributeError**: Wrong method names (eg., `.push()` instead of `.append()`)
1414
- **TypeError**: Type mismatches
1515
- **UnboundLocalError**: Variables used before assignment
1616
- **IndexError**: List index out of range

scripts/import_copydeck_csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
preserved from the source copydeck - reviewers cannot change match logic.
88
99
The reader tolerates the mutations a spreadsheet round-trip introduces:
10-
* blank rows above the header (e.g. a frozen spacer row)
10+
* blank rows above the header (eg. a frozen spacer row)
1111
* header capitalisation ("Title", "Error_type", "Step_1", ...)
1212
* extra columns added by reviewers (ID, links, status flags), in any order
1313

scripts/release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# including a 2FA OTP prompt if enabled) and `gh auth login` (for the release).
1313
#
1414
# Keep this script ASCII-only and brace every "${var}" reference. Under `set -u`,
15-
# a $var directly abutting a multibyte character (e.g. an ellipsis) is parsed as
15+
# a $var directly abutting a multibyte character (eg. an ellipsis) is parsed as
1616
# part of the variable name and crashes with "unbound variable".
1717

1818
set -euo pipefail
@@ -68,7 +68,7 @@ npm run build:all
6868

6969
# --- Bump + tag (local only so far) -----------------------------------------
7070
# npm version updates package.json + package-lock.json, commits, and tags vX.Y.Z.
71-
newtag="$(npm version "${bump}" -m "Release v%s")" # prints e.g. "v0.4.0"
71+
newtag="$(npm version "${bump}" -m "Release v%s")" # prints eg. "v0.4.0"
7272
echo "Bumped ${current} -> ${newtag}"
7373

7474
# --- Publish to npm ---------------------------------------------------------

tests/engine.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const copydeck = {
1111
title: "This name doesn't exist yet",
1212
summary: "Your code uses \"{{name}}\", but it hasn't been created yet. Check {{loc}}.",
1313
why: "Python needs to see a line that creates \"{{name}}\" before you use it.",
14-
steps: ["Make it first (e.g. {{name}} = 0).", "Check spelling."]
14+
steps: ["Make it first (eg. {{name}} = 0).", "Check spelling."]
1515
},
1616
{
1717
if: { match_message: ["is not defined"] },
@@ -46,7 +46,7 @@ const copydeck = {
4646
steps: ["Use list.append(value)."]
4747
},
4848
{
49-
title: "This thing doesn't have that name after the dot",
49+
title: "This object doesn't have that name after the dot",
5050
summary: "No such attribute.",
5151
steps: ["Check spelling."]
5252
}
@@ -67,7 +67,7 @@ ValueError: invalid literal for int() with base 10: 'abc'`;
6767
expect(res).toBeNull();
6868
});
6969

70-
it("lets caller-provided file/line override the trace (e.g. Pyodide's <exec>)", () => {
70+
it("lets caller-provided file/line override the trace (eg. Pyodide's <exec>)", () => {
7171
const code = `for i in range(3)\n print(i)`;
7272
const raw = `Traceback (most recent call last):
7373
File "/lib/python312.zip/_pyodide/_base.py", line 148, in _parse_and_compile_gen

0 commit comments

Comments
 (0)