#15987: Python 3 preparation: Change syntax of long and octal integer literals
-------------------------------------+-------------------------------------
       Reporter:  wluebbe            |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.2
      Component:  distribution       |   Resolution:
       Keywords:  python3            |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/wluebbe/ticket/15987             |  a17cb523eba3d523e71d3a2c4f9b4bf90ad44ef7
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by ohanar):

 Replying to [comment:1 wluebbe]:
 > 2to3 has found nothing for the long integer literal (suffix "L").[[br]]
 > 13 modules were found with regexp search (r"\s (0\d+) [\s)]"). The
 result file is attached.
 > * 6 pyx modules from {{{sage/rings/padics}}} contain code like {{{(1L <<
 (sizeof(long) * 8 - 2)) - 1}}}. I do not whether these should be changed.

 These should be fine, long integer literals are important to C and hence
 you cannot always drop them in Cython code (even for Cython written
 specifically written for Python 3).

 > * 4 modules had doc-test with stuff like {{{4561L   # 32-bit}}}. Perhaps
 these test can be made more tolerant.

 How do you propose? The issue is that the Cython code is likely written
 with 64-bit integers, which on 32-bit platforms cannot always be placed
 into a Python2 int (since they are just a simple wrapper for the
 underlying platforms C long). In general you will get this issue when
 dealing with large integers, it is just mostly avoid in sage since we
 usually return Sage integers instead of Python ints or longs.

--
Ticket URL: <http://trac.sagemath.org/ticket/15987#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to