Andrew Berg writes:
> So that's where that info is. I wasn't looking in the tutorial
> section.
Does this mean you haven't worked through the tutorial? Time to remedy
that.
--
\ “You are welcome to visit the cemetery where famous Russian and |
`\Soviet composers, artists, and writer
On Thu, 12 May 2011 15:26:27 -0500, Tycho Andersen wrote:
> On Thu, May 12, 2011 at 03:12:39PM -0500, Andrew Berg wrote:
>> On 2011.05.12 02:25 PM, MRAB wrote:
>> > You can raise an exception wherever you like! :-)
>> If I raise an exception that isn't a built-in exception, I get
>> something like
On 2011.05.12 03:20 PM, Corey Richardson wrote:
> class HelloError(Exception):
> pass
>
> Of course, there are all sorts of other things you could do with your
> exception.
>
> http://docs.python.org/tutorial/errors.html#user-defined-exceptions
So that's where that info is. I wasn't looking in
Andrew Berg wrote:
On 2011.05.12 02:25 PM, MRAB wrote:
You can raise an exception wherever you like! :-)
If I raise an exception that isn't a built-in exception, I get something
like "NameError: name 'HelloError' is not defined". I don't know how to
define the exception.
class HelloError(Exce
On 12/05/2011 21:12, Andrew Berg wrote:
On 2011.05.12 02:25 PM, MRAB wrote:
You can raise an exception wherever you like! :-)
If I raise an exception that isn't a built-in exception, I get something
like "NameError: name 'HelloError' is not defined". I don't know how to
define the exception.
On Thu, May 12, 2011 at 03:12:39PM -0500, Andrew Berg wrote:
> On 2011.05.12 02:25 PM, MRAB wrote:
> > You can raise an exception wherever you like! :-)
> If I raise an exception that isn't a built-in exception, I get something
> like "NameError: name 'HelloError' is not defined". I don't know how
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/12/2011 04:12 PM, Andrew Berg wrote:
> On 2011.05.12 02:25 PM, MRAB wrote:
>> You can raise an exception wherever you like! :-)
> If I raise an exception that isn't a built-in exception, I get something
> like "NameError: name 'HelloError' is not
On 2011.05.12 02:25 PM, MRAB wrote:
> You can raise an exception wherever you like! :-)
If I raise an exception that isn't a built-in exception, I get something
like "NameError: name 'HelloError' is not defined". I don't know how to
define the exception.
--
http://mail.python.org/mailman/listinfo/
On 12/05/2011 20:14, Andrew Berg wrote:
On 2011.05.11 01:05 PM, Roy Smith wrote:
You want to raise specific errors. Let's say you've got a function like
this:
def airspeed(swallow):
speeds = {"european": 42,
"african", 196}
return speeds[swallow]
If somebody passes an in
On 2011.05.11 01:05 PM, Roy Smith wrote:
> You want to raise specific errors. Let's say you've got a function like
> this:
>
> def airspeed(swallow):
>speeds = {"european": 42,
> "african", 196}
>return speeds[swallow]
>
> If somebody passes an invalid string, it will raise K
way to handle errors in a module
On 2011.05.11 12:57 PM, Patty wrote:
> Hi Andrew -
>
> Sometimes you want an exception come up and then use that information to
> take your
> program in some direction.
Right, but I'm wondering how I should handle errors in a module, where
differ
On 2011.05.11 12:57 PM, Patty wrote:
> Hi Andrew -
>
> Sometimes you want an exception come up and then use that information to
> take your
> program in some direction.
Right, but I'm wondering how I should handle errors in a module, where
different people will want their programs to do different
In article ,
Andrew Berg wrote:
> I'm a bit new to programming outside of shell scripts (and I'm no expert
> there), so I was wondering what is considered the best way to handle
> errors when writing a module. Do I just let exceptions go and raise
> custom exceptions for errors that don't trigge
On 11/05/2011 18:29, Andrew Berg wrote:
I'm a bit new to programming outside of shell scripts (and I'm no expert
there), so I was wondering what is considered the best way to handle
errors when writing a module. Do I just let exceptions go and raise
custom exceptions for errors that don't trigger
- Original Message -
From: "Andrew Berg"
To:
Sent: Wednesday, May 11, 2011 10:29 AM
Subject: Proper way to handle errors in a module
I'm a bit new to programming outside of shell scripts (and I'm no expert
there), so I was wondering what is considered the best way to handle
errors
15 matches
Mail list logo