[Python-Dev] Bug in from __future__ processing?

Guido van Rossum guido at python.org
Sat Mar 4 05:21:55 CET 2006


On 3/3/06, Tim Peters <tim.peters at gmail.com> wrote:
> [Martin Maly]
> > The Python spec states that the "from __future__ import …" statement can
> > only occur at the beginning of the file, preceded only by doc strings,
> > comments, empty lines or other future statements. The following code
> > snippets, however, don't raise Syntax error in Python 2.4.2. Is it a bug?
> >
> > I am asking whether in IronPython we should try to match behavior of Python
> > compiler, or stick to the language spec. In this case, I believe that we
> > should stick to the spec and report a bug in Python compiler.
>
> Guido bumped into this about a month ago, noting that he thought it
> was a bug in current Python trunk that the PEP restrictions _are_
> followed now.  I replied that I thought it was a bug in released
> Pythons that the PEP restrictions were _not_ followed:
>
>     http://mail.python.org/pipermail/python-dev/2006-January/060247.html
>
> Doesn't look like Guido responded, so I'll channel him and declare
> that he intended to agree with me after all ;-)

It was so obvious that you were right I didn't bother to agree at the
time. But yes, I agree. And I swear on a stack of Python 1.5.2
language reference manuals that you didn't have to twist my arm. :-)

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list