Repository navigation
Commit 1165bb0
Fix typing of array.typecodes for Python 3.15
Python 3.15 changed array.typecodes from str to tuple to support
type codes longer than 1 character (Zf and Zd).
See python/cpython#148675
Pythran's fill_constants_types() uses type() introspection on live
Python constants to set signatures, which now produces tuple instead
of str. Meanwhile, the explicit ConstantIntr(signature=str) was
silently ignored because ConstantIntr.__init__ never stored it.
Fix ConstantIntr to preserve an explicitly provided signature, and
skip introspection in fill_constants_types when one is already set.
Without the fix, pytest pythran/tests/test_array.py -k test_typecodes
fails with:
else:
> raise NotImplementedError(t)
E NotImplementedError: <class 'tuple'>
pythran/types/tog.py:480: NotImplementedError
Assisted-By: Claude Opus 4.61 parent 6e3af75 commit 1165bb0
2 files changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4731 | 4731 | | |
4732 | 4732 | | |
4733 | 4733 | | |
4734 | | - | |
4735 | | - | |
4736 | | - | |
| 4734 | + | |
| 4735 | + | |
| 4736 | + | |
| 4737 | + | |
4737 | 4738 | | |
4738 | 4739 | | |
4739 | 4740 | | |
| |||
0 commit comments