Commit 3abe301
fix(python): rename FormattableString field from str to fmt
The Python representation of FormattableString used a field literally
named `str`, producing an object expression with a `@property def str`.
While this runs correctly (the `-> str` return annotation resolves to
the builtin under PEP 563, and Pyright accepts it), Astral's `ty` type
checker resolves the annotation against the class-scoped `str` property
and reports a false-positive `invalid-type-form` error.
Rename the internal field to `fmt`, which sidesteps the builtin-name
collision entirely. The field is internal to the `formattableString`
replacement (written by `Create`, read by `get_Format`), so the change
is fully self-contained.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 4c36f76 commit 3abe301
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
1681 | | - | |
1682 | | - | |
| 1681 | + | |
| 1682 | + | |
1683 | 1683 | | |
1684 | 1684 | | |
1685 | 1685 | | |
| |||
0 commit comments