python / python/cpython

Consider having int() support MINUS SIGN

Đang mở
#144,087 29 bình luận 4 reaction 1 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

interpreter-core type-feature
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

The int() function supports all Nd unicode digit variants so that int('\N{digit one}') == int('\N{arabic-indic digit one}').

Likewise, the int() function supports all Zs space character variants to that int('\N{space}123') == int('\N{no-break space}123').

However, the function does not support negation variants so that int('\N{hyphen-minus}\N{digit one}') succeeds while int('\N{minus sign}\N{digit one}') fails.

I found this issue while parsing a Table of Jacobi Symbol Values. All of the −1 entries are a MINUS SIGN and DIGIT ONE. I would have expected all minus sign variants to be supported.

Linked PRs
  • gh-144095

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.