gh-144087: Add support for unicode MINUS SIGN in int, float and complex#144095
gh-144087: Add support for unicode MINUS SIGN in int, float and complex#144095johnslavik wants to merge 22 commits intopython:mainfrom
int, float and complex#144095Conversation
|
LGTM. Needs tests and blurb. Maybe consider making the assignment a constant instead of a comment, though I don't feel strongly about it. |
Yep! Work in progress. Thanks for chiming in :) |
|
This also needs documentation. I would guess, it will take major part of the PR. |
How about only checking for the first non whitespace character? signs should not appear in the middle of a number unless they are in the e/E/p suffix I guess? |
Hardly this optimizes something.
Yes. _PyUnicode_TransformDecimalAndSpaceToASCII() used for floats and complexes (which gives another case of "sign in the middle") too. |
Some tests are failing!
- `CAPIFloatTest.test_fromstring` doesn't test for minus signs - I can't find `complex` C API tests
I think that reads better
I don't see a different approach to solving this that is equally or more optimal in terms of trade-offs. If there's any alternative approach that I've missed, please let me know.