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


Groups > comp.lang.python > #62997 > unrolled thread

Re: About some problem

Started byMark Lawrence <breamoreboy@yahoo.co.uk>
First post2014-01-02 19:27 +0000
Last post2014-01-03 13:17 -0800
Articles 8 — 4 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  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

#62997 — Re: About some problem

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-01-02 19:27 +0000
SubjectRe: About some problem
Message-ID<mailman.4806.1388690867.18130.python-list@python.org>
On 02/01/2014 17:46, Rustom Mody wrote:
>
> Oh ok I get what you are saying: python3 will not recognize a python2
> package and install it seemingly correctly but actually wrongly
>

No, it will install it quite correctly.  What it won't know is that some 
of the code is valid in Python 2 but invalid in Python 3.  An example I 
discovered 30 minutes ago.

raise "Not Valid DB Type"

is perfectly valid in Python 2.  In Python 3 it's so illegal the 2to3 
conversion tool can't cope with it :(

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

[toc] | [next] | [standalone]


#63008

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2014-01-03 10:49 +1100
Message-ID<52c5fb00$0$29981$c3e8da3$5496439d@news.astraweb.com>
In reply to#62997
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.


You know how the world ended when Python 2.6 broke backwards compatibility
and split the Python community into two? No, me neither.

-- 
Steven

[toc] | [prev] | [next] | [standalone]


#63016

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-01-03 01:14 +0000
Message-ID<mailman.4818.1388711657.18130.python-list@python.org>
In reply to#63008
On 02/01/2014 23:49, 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.
>

Thaanks for the correction.

> You know how the world ended when Python 2.6 broke backwards compatibility
> and split the Python community into two? No, me neither.
>

I'm 100% certain that you're wrong on this one, the split was simply 
never noticed by anybody :)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#63033

FromEthan Furman <ethan@stoneleaf.us>
Date2014-01-02 20:18 -0800
Message-ID<mailman.4830.1388724080.18130.python-list@python.org>
In reply to#63008
On 01/02/2014 05:14 PM, Mark Lawrence wrote:
> On 02/01/2014 23:49, 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.
>>
>
> Thaanks for the correction.
>
>> You know how the world ended when Python 2.6 broke backwards
>> compatibility
>> and split the Python community into two? No, me neither.
>>
>
> I'm 100% certain that you're wrong on this one, the split was simply
> never noticed by anybody :)

Actually, the split was so severe the universe itself noticed and split 
into two -- one where folks noticed, and one where nobody did... I 
wonder which one we're in?

--
~Ethan~

[toc] | [prev] | [next] | [standalone]


#63035

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-01-03 04:46 +0000
Message-ID<mailman.4832.1388724353.18130.python-list@python.org>
In reply to#63008
On 03/01/2014 04:18, Ethan Furman wrote:
> On 01/02/2014 05:14 PM, Mark Lawrence wrote:
>> On 02/01/2014 23:49, 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.
>>>
>>
>> Thaanks for the correction.
>>
>>> You know how the world ended when Python 2.6 broke backwards
>>> compatibility
>>> and split the Python community into two? No, me neither.
>>>
>>
>> I'm 100% certain that you're wrong on this one, the split was simply
>> never noticed by anybody :)
>
> Actually, the split was so severe the universe itself noticed and split
> into two -- one where folks noticed, and one where nobody did... I
> wonder which one we're in?
>
> --
> ~Ethan~
>

The one where Breamore's at the centre.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#63082

FromAndré Malo <ndparker@gmail.com>
Date2014-01-03 21:28 +0100
Message-ID<5838476.4I4dOAImpA@news.perlig.de>
In reply to#63008
* 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/ #

[toc] | [prev] | [next] | [standalone]


#63085

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2014-01-04 07:55 +1100
Message-ID<52c723bc$0$29982$c3e8da3$5496439d@news.astraweb.com>
In reply to#63082
André Malo wrote:

> * 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.

Oh, it's a runtime TypeError, not SyntaxError. I learn something new
everyday, thanks for the correction.



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#63087

FromEthan Furman <ethan@stoneleaf.us>
Date2014-01-03 13:17 -0800
Message-ID<mailman.4869.1388785310.18130.python-list@python.org>
In reply to#63085
On 01/03/2014 12:55 PM, Steven D'Aprano wrote:
> André Malo wrote:
>
>> * 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.
>
> Oh, it's a runtime TypeError, not SyntaxError.

The main point being that in 2.6 and 2.7 string exceptions do /not/ work.

--
~Ethan~

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web