Ticket #11424 (closed defect: fixed)
Build Integer from Unicode
| Reported by: | vdelecroix | Owned by: | vdelecroix |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.7.2 |
| Component: | basic arithmetic | Keywords: | Integer, unicode |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | Mariah Lenox |
| Authors: | Vincent Delecroix | Merged in: | sage-4.7.2.alpha1 |
| Dependencies: | Stopgaps: |
Description (last modified by vdelecroix) (diff)
Currently, Sage fails to build Integer from Unicode
sage: Integer(u'1') TypeError Traceback (most recent call last) ... TypeError: unable to coerce <type 'unicode'> to an integer
The two lines patch attached to this ticket, allow such feature
sage: Integer(u'1') 1 sage: Integer(u'0X13') 19
Attachments
Change History
comment:2 Changed 2 years ago by mariah
- Status changed from needs_review to positive_review
- Reviewers set to Mariah Lenox
Patch fixes the reported problem. Did 'make testlong' and all tests passed. Positive review!
comment:3 follow-up: ↓ 4 Changed 2 years ago by jdemeyer
- Status changed from positive_review to needs_work
- The commit message of the patch should be changed.
- Could you give a less trivial example in the doctest? At least something with more than one digit and something hexadecimal (Integer(u'0x2A')) or so...
comment:4 in reply to: ↑ 3 Changed 2 years ago by vdelecroix
- Status changed from needs_work to needs_review
- Description modified (diff)
Replying to jdemeyer:
Thanks for comment.
- The commit message of the patch should be changed.
I add the number of the ticket and a short description.
- Could you give a less trivial example in the doctest? At least something with more than one digit and something hexadecimal (Integer(u'0x2A')) or so...
Done.
Note: See
TracTickets for help on using
tickets.

