Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Integer from Unicode #11424

Closed
videlec opened this issue Jun 3, 2011 · 7 comments
Closed

Build Integer from Unicode #11424

videlec opened this issue Jun 3, 2011 · 7 comments

Comments

@videlec
Copy link
Contributor

videlec commented Jun 3, 2011

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

Component: basic arithmetic

Keywords: Integer, unicode

Author: Vincent Delecroix

Reviewer: Mariah Lenox

Merged: sage-4.7.2.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/11424

@videlec videlec added this to the sage-4.7.1 milestone Jun 3, 2011
@videlec videlec self-assigned this Jun 3, 2011
@sagetrac-mariah
Copy link
Mannequin

sagetrac-mariah mannequin commented Jun 10, 2011

comment:2

Patch fixes the reported problem. Did 'make testlong' and all tests passed. Positive review!

@sagetrac-mariah
Copy link
Mannequin

sagetrac-mariah mannequin commented Jun 10, 2011

Reviewer: Mariah Lenox

@jdemeyer
Copy link

comment:3
  1. The commit message of the patch should be changed.
    2. 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...

@videlec
Copy link
Contributor Author

videlec commented Jun 19, 2011

comment:4

Attachment: trac_11424-unicode_to_integer.patch.gz

Replying to @jdemeyer:

Thanks for comment.

  1. The commit message of the patch should be changed.

I add the number of the ticket and a short description.

  1. 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.

@videlec

This comment has been minimized.

@sagetrac-mariah
Copy link
Mannequin

sagetrac-mariah mannequin commented Jun 21, 2011

comment:5

Applied patch, did 'sage -b' and 'make testlong'. All tests passed. Positive review!

@jdemeyer
Copy link

Merged: sage-4.7.2.alpha1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants