Commit 36825c1
The Python emitter mapped the TypeSpec `numeric` scalar to `int`,
truncating floating-point values for operations like:
```typespec
op nooooooo(): numeric;
```
Since `numeric` is the parent of both integer and float scalars, `int`
is unsound — `float` is the correct Python representation.
### Changes
- **`packages/http-client-python/emitter/src/types.ts`**: In
`sdkScalarKindToPythonKind`, change `numeric: "integer"` → `numeric:
"float"`.
- **Changeset**: Added a `fix` entry for `@typespec/http-client-python`.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
1 parent 7ff22d0 commit 36825c1
2 files changed
Lines changed: 8 additions & 1 deletion
File tree
- .chronus/changes
- packages/http-client-python/emitter/src
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
| 439 | + | |
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| |||
0 commit comments