gvwilson@nevex.com writes: >Once 1.6 is out the door, would people be willing to consider extendin= g >Python's token set to make HTML/XML-ish spellings using entity referen= ces >legal? This would make the following 100% legal Python: > >i =3D 0 >while i < 10: > print i & 1 > i =3D i + 1 I don't think that would be sufficient. What about user-defined entities, as in résultat =3D max(a,b)? (r=9Bsultat, in French.)= Would Python have to also parse a DTD from somewhere? What about other places when Python and XML syntax collide, as in this contrived example: <![CDATA[ # Python code starts here if a[index[1]]>b: print ... Oops! The ]]> looks like the end of the CDATA section, but it's legal Python code. IMHO whatever tool is outputting the XML should handle escaping wacky characters in the Python code, which will be undone by the parser when the XML gets parsed. Users certainly won't be writing this XML by hand; writing 'if (i < 10)' is very strange. --=20 A.M. Kuchling=09=09=09http://starship.python.net/crew/amk/ Art history is the nightmare from which art is struggling to awake. -- Robert Fulford
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4