[Python-bugs-list] [Bug #110830] Syntax (PR#177)

noreply@sourceforge.net noreply@sourceforge.net
Thu, 3 Aug 2000 13:00:38 -0700


Bug #110830, was updated on 2000-Aug-01 14:12
Here is a current snapshot of the bug.

Project: Python
Category: None
Status: Open
Resolution: Later
Bug Group: Feature Request
Priority: 1
Summary: Syntax (PR#177)

Details: Jitterbug-Id: 177
Submitted-By: simonb@logical.co.za
Date: Tue, 11 Jan 2000 05:17:37 -0500 (EST)
Version: 1-5-2
OS: NT 4.0


Hi there

I don't know if this is a bug, or is intentional behaviour for a specific
reason.

The following code produces a syntax error about the continue not being within a
looping structure rather than a prefectly silly infinite loop...

while 1:
  try:
    continue
  except:
    pass

where the following works as one would expect...

while 1:
  try:
    raise 1
  except:
    continue

I figure that there is more likely a sane reason for this behaviour than being a
bug, but I am curious.

Thanks
Simon



====================================================================
Audit trail:
Wed Jan 12 18:11:45 2000	guido	changed notes
Wed Jan 12 18:11:45 2000	guido	moved from incoming to request

Follow-Ups:

Date: 2000-Aug-01 14:12
By: none

Comment:
From: "Tim Peters" <tim_one@email.msn.com>
Subject: RE: [Python-bugs-list] Syntax (PR#177)
Date: Tue, 11 Jan 2000 12:10:17 -0500

[Simon Barratt, putting "continue" in a "try" block]
> I don't know if this is a bug, or is intentional behaviour
> for a specific reason.

Actually, it's a bit of both <wink>.  See the Language Reference Manual's
section on the "continue" statement, particularly the footnote:

    The restriction on occurring in the try clause is
    implementer's laziness and will eventually be lifted.

It's been this way (and documented) forever; it's simply hard to implement
given the current structure of the interpreter loop.

Rest assured there's nothing *conceptually* wrong with putting continue in a
try!  It's simply an implementation restriction; the error msg should
probably make that clearer.  IIRC, JPython doesn't have this restriction.
"Someday" it will get repaired in CPython too.



-------------------------------------------------------

Date: 2000-Aug-01 14:12
By: none

Comment:
It's a zero-priority bug (i.e. not likely to be fixed).

-------------------------------------------------------

Date: 2000-Aug-03 13:00
By: twouters

Comment:
Like the bot said, low priority 'to be fixed' bug.

-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=110830&group_id=5470