Peter Funk wrote: > > Fred L. Drake, Jr.: > > M.-A. Lemburg writes: > > > Here's a simple strawman for the syntax: > > ... > > > The compiler would scan these pragma defs, add them to an > > > internal temporary dictionary and use them for all subsequent > > > code it finds during the compilation process. The dictionary > > > would have to stay around until the original compile() call has > > > completed (spanning recursive calls). > > > > Marc-Andre, > > The problem with this proposal is that the pragmas are embedded in > > the comments; I'd rather see a new keyword and statement. It could be > > defined something like: > > > > pragma_atom: NAME | NUMBER | STRING+ > > pragma_stmt: 'pragma' NAME ':' pragma_atom (',' pragma_atom)* > > This would defeat an important goal: backward compatibility: You > can't add 'pragma division: old' or something like this to a source > file, which should be able to run with both Python 1.5.2 and Py3k. > This would make this mechanism useless for several important > applications of pragmas. Hmm, I don't get it: these pragmas would set variabels which make Python behave in a different way -- how do you plan to achieve backward compatibility here ? I mean, u = u"abc" raises a SyntaxError in Python 1.5.2 too... -- Marc-Andre Lemburg ______________________________________________________________________ Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
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