[Python-Dev] Pragmas: Just say "No!"

M.-A. Lemburg mal@lemburg.com
Thu, 31 Aug 2000 15:32:41 +0200


Neil Hodgson wrote:
> 
> Greg Ewing:
> > Greg Wilson <gvwilson@nevex.com>:
> >
> > > Pragmas are a way to embed programs for the
> > > parser in the file being parsed.
> >
> > I hope the BDFL has the good sense to run screaming from
> > anything that has the word "pragma" in it. As this discussion
> > demonstrates, it's far too fuzzy and open-ended a concept --
> > nobody can agree on what sort of thing a pragma is supposed
> > to be.
> 
>    It is a good idea, however, to claim a piece of syntactic turf as early
> as possible so that if/when it is needed, it is unlikely to cause problems
> with previously written code. My preference would be to introduce a reserved
> word 'directive' for future expansion here. 'pragma' has connotations of
> 'ignorable compiler hint' but most of the proposed compiler directives will
> cause incorrect behaviour if ignored.

The objectives the "pragma" statement follows should be clear
by now. If it's just the word itself that's bugging you, then
we can have a separate discussion on that. Perhaps "assume"
or "declare" would be a better candidates.

We need some kind of logic of this sort in Python. Otherhwise
important features like source code encoding will not be
possible.

As I said before, I'm not advertising adding compiler
programs to Python, just a simple way of passing information
for the compiler.

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/