[Python-Dev] Pragma-style declaration syntax (original) (raw)

M.-A. Lemburg mal@lemburg.com
Tue, 29 Aug 2000 12:40:11 +0200


Jack Jansen wrote:

> The basic syntax in the above examples is: > > "pragma" NAME "=" (NUMBER | STRING+) > > It has to be that simple to allow the compiler use the information > at compilation time. Can we have a bit more syntax, so other packages that inspect the source (freeze and friends come to mind) can also use the pragma scheme? Something like "pragma" NAME ("." NAME)+ "=" (NUMBER | STRING+) should allow freeze to use something like pragma freeze.exclude = "win32ui, sunaudiodev, linuxaudiodev" which would be ignored by the compiler but interpreted by freeze. And, if they're stored in the pragma dictionary too, as was suggested here, you can also add pragmas specific for class browsers, debuggers and such.

Hmm, freeze_exclude would have also done the trick.

The only thing that will have to be assured is that the arguments are readily available at compile time. Adding a dot shouldn't hurt ;-)

-- Marc-Andre Lemburg


Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/