On Fri, Mar 4, 2011 at 12:33 PM, Simon King <simon.k...@uni-jena.de> wrote: > Hi Robert, > > On 4 Mrz., 19:39, Robert Bradshaw <rober...@math.washington.edu> > wrote: >> > How to test whether something is a valid identifier in Python3? I >> > don't know. >> >> Fortunately, Python is open source :) I can't imagine it would be that >> hard to figure out. > > I know where to find the Sage sources (although I tend to forget where > I can get alpha versions from). But I don't know where to find the > Python3 sources, and I don't know how long I would need before I > understant that code (I am used to read code *in* Python, but not the > code *of* Python).
http://svn.python.org/projects/python/branches/py3k/Objects/unicodeobject.c See the PyUnicode_IsIdentifier function. It may be just as easy to implement from the spec in PEP 3131 itself. - 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