Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: What am I doing wrong here?

Reply
Thread Tools

Re: What am I doing wrong here?

 
 
Aahz
Guest
Posts: n/a
 
      06-30-2003
In article <7sNLa.30264$(E-Mail Removed)>,
Bill C. Wong <(E-Mail Removed)> wrote:
>
>################################
>def func( s ):
> s1, s2 = s.split( ' ', 1 )
> try:
> raise s1
> except "aaaa":
> print 'except "aaaa"'
> except:
> print 'except:'
>
>s = "aaaa "
>func( s )
>################################
>If I manually assign s1 with s1 = "aaaa", then it works fine! What am I
>doing wrong here?


Let me repeat and emphasize Gerhard's second post:

DO NOT USE STRING EXCEPTIONS

String exceptions are informally deprecated (and have been since Python
1.5.2); they will likely be formally deprecated in Python 2.4; they will
disappear in Python 3.0.
--
Aahz ((E-Mail Removed)) <*> http://www.pythoncraft.com/

Usenet is not a democracy. It is a weird cross between an anarchy and a
dictatorship.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
inter vlan routing - What am I doing wrong? Joel M. Baldwin Cisco 0 12-15-2004 02:47 AM
PIX setting up multiple static routes what am I doing wrong? newb Cisco 1 09-10-2004 09:07 PM
What am I doing wrong when using "use strict" ? ed Perl 1 01-05-2004 01:22 PM
VB6/VB.Net Programming Question - what am i doing wrong? Salisha Khan ASP .Net 1 08-01-2003 01:55 PM
What am I doing wrong? Keith R. Williams VHDL 4 07-15-2003 03:08 AM



Advertisments