On Sat, Mar 5, 2011 at 12:26 AM, Simon King <simon.k...@uni-jena.de> wrote: > Hi Robert, > > On 4 Mrz., 22:18, Robert Bradshaw <rober...@math.washington.edu> > wrote: >> ... >> See the PyUnicode_IsIdentifier function. > > ... which soon refers to two other functions (_PyUnicode_IsXidStart > and _PyUnicode_IsXidContinue) that test whether a character is > acceptible at the beginning resp. in everything but the beginning of > an identifier. They do the real job, and I can't see where they are > imported from.
Gotta love C :). I think they're in unicodetype and unicode_db. Really, these are just part of the unicode standard. > With Google, I found some general properties that these functions have > to satisfy, such as "If something is accepted by > _PyUnicode_IsXidStart, it must be accepted by _PyUnicode_IsXidContinue > as well". But again I found no code, and in particular I did not find > *which* characters are accepted. > >> It may be just as easy to >> implement from the spec in PEP 3131 itself. > > Do you suggest to add a patch to the Python version (2.6.4?) shipped > with sage, or do you suggest to add a little function written in > Python 2.6.4 to the Sage library (say, in sage.misc.default) that > mimmicks what Python 3k does? The latter. It would, of course, leverage the unicode character database that Python currently has. Perhaps we'd patch python if the 2.6.4 unicodetype_db is insufficient. - Robert -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org