Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #63082

Re: About some problem

From André Malo <ndparker@gmail.com>
Newsgroups comp.lang.python
Subject Re: About some problem
Date 2014-01-03 21:28 +0100
Organization TIMTOWTDI
Message-ID <5838476.4I4dOAImpA@news.perlig.de> (permalink)
References (2 earlier) <CAJ+Teoc0f3S2FRPwrtHuao+7aKiA=57Nn1UVpoH0-3WRTNQbgg@mail.gmail.com> <la483g$19i$1@ger.gmane.org> <CAJ+TeocR3HOrs-Unq7LDaPnbrVRFLVyGn7TPPy=gMmh0diB3OQ@mail.gmail.com> <mailman.4806.1388690867.18130.python-list@python.org> <52c5fb00$0$29981$c3e8da3$5496439d@news.astraweb.com>

Show all headers | View raw


* Steven D'Aprano wrote:

> Mark Lawrence wrote:
> 
>> raise "Not Valid DB Type"
>> 
>> is perfectly valid in Python 2.
> 
> Actually, no it isn't. It's only valid up to Python 2.4. In Python 2.5,
> string exceptions display a warning but continue to work, and in Python
> 2.6 they generate a compile-time SyntaxError.

Oh? Doesn't look like it.

$ cat x.py
try:
    raise "foo"
except:
    print "bar"

$ python2.7 x.py
bar
$ python2.6 x.py
bar

A lone '''raise "foo"''' raises a TypeError, though.

nd
-- 
sub the($){+shift} sub answer (){ord q
        [* It is always 42! *]       }
           print the answer
# André Malo # http://pub.perlig.de/ #

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: About some problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-02 19:27 +0000
  Re: About some problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-01-03 10:49 +1100
    Re: About some problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-03 01:14 +0000
    Re: About some problem Ethan Furman <ethan@stoneleaf.us> - 2014-01-02 20:18 -0800
    Re: About some problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-03 04:46 +0000
    Re: About some problem André Malo <ndparker@gmail.com> - 2014-01-03 21:28 +0100
      Re: About some problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-01-04 07:55 +1100
        Re: About some problem Ethan Furman <ethan@stoneleaf.us> - 2014-01-03 13:17 -0800

csiph-web