On Sat, May 21, 2011 at 3:40 PM, Cameron Simpson c...@zip.com.au wrote:
These days I think I'd use a LateFunction (a facility of my own which is
a lot like the futures module) which returns a callable when you submit
a function; the worker thread runs the submitted function and catches the
On Tue, May 10, 2011 at 11:40 AM, Kyle T. Jones
onexpadrem...@evomeryahoodotyouknow.com wrote:
It has been hard for me to determine what would constitute overuse.
Good example of abuse is catching KeyboardInterrupt or SystemExit
inside some library code. PycURL does it, and its truly annoying.
On 11May2011 13:37, James Mills prolo...@shortcircuit.net.au wrote:
| On Tue, May 10, 2011 at 7:34 PM, Jean-Michel Pichavant
| jeanmic...@sequans.com wrote:
| You can reraise the exception without loosing the stack trace.
|
| try:
| ...
| except SomeException, exc:
| log(exc)
| print 'Hello
James Mills wrote:
On Tue, May 10, 2011 at 10:40 AM, Kyle T. Jones
onexpadrem...@evomeryahoodotyouknow.com wrote:
It has been hard for me to determine what would constitute overuse.
A rule of thumb I always follow and practice is:
Let the error lie where it occurred.
or
Don't hide
On Mon, 2011-05-09 at 19:40 -0500, Kyle T. Jones wrote:
It has been hard for me to determine what would constitute overuse.
The chronic problem is under use; so I wouldn't worry much about it.
try/except should occur as often as is required for the application to
either deal gracefully with the
On Tue, 10 May 2011 07:36:42 -0400, Adam Tauno Williams
awill...@whitemice.org wrote:
: On Mon, 2011-05-09 at 19:40 -0500, Kyle T. Jones wrote:
: It has been hard for me to determine what would constitute overuse.
:
: The chronic problem is under use; so I wouldn't worry much about it.
:
:
On 05/09/2011 07:40 PM, Kyle T. Jones wrote:
It has been hard for me to determine what would constitute overuse.
Cheers.
Well, for me the power of exceptions is that it lets me write much more
concise code. For example, suppose I call a routine I wrote over and
over, and I have to check for
On Tue, May 10, 2011 at 7:34 PM, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
You can reraise the exception without loosing the stack trace.
try:
...
except SomeException, exc:
log(exc)
print 'Hello world'
raise # raise exc would loose the original stack trace
Valid point :)
It has been hard for me to determine what would constitute overuse.
Cheers.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, May 10, 2011 at 10:40 AM, Kyle T. Jones
onexpadrem...@evomeryahoodotyouknow.com wrote:
It has been hard for me to determine what would constitute overuse.
A rule of thumb I always follow and practice is:
Let the error lie where it occurred.
or
Don't hide errors..
It's good practice
10 matches
Mail list logo