Thank you Steven and Konstantin, that clears things up.
Sometimes I forget how incomplete my Python Essential Reference is.
James
On Monday 20 June 2005 05:40 pm, Steven Bethard wrote:
> Well, it's not a bug, because that's what the documentation says it'll do:
>
> "The second object is used to
On 6/21/05, Steven Bethard <[EMAIL PROTECTED]> wrote:
> James Stroud wrote:
> P.S. If you insist on using the two argument version of raise, you can
> do it like this:
>
> py> class E(Exception):
> ... def __init__(self, atup):
> ... Exception.__init__(self, "Error with %s-%s" % atup)
On 6/21/05, James Stroud <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> Is this a bug?
No, it works as documented. You should've consulted language reference:
http://docs.python.org/ref/raise.html
- kv
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
> Hello All,
>
> Is this a bug? Why is this tuple getting unpacked by raise? Am I missing some
> subtle logic? Why does print not work the same way as raise? Both are
> statements. Why does raise need to be so special?
>
> py> sometup = 1,2
> py> print sometup
> (1, 2)
> py>
Hello All,
Is this a bug? Why is this tuple getting unpacked by raise? Am I missing some
subtle logic? Why does print not work the same way as raise? Both are
statements. Why does raise need to be so special?
py> sometup = 1,2
py> print sometup
(1, 2)
py> print 1,2,3, sometup
1 2 3 (1, 2)
py> c