[Tutor] finally without try or except
Tino Dai
oberoc at gmail.com
Mon Jul 30 21:51:38 CEST 2012
On Mon, Jul 30, 2012 at 3:35 PM, Brett Ritter <swiftone at swiftone.org> wrote:
> On Mon, Jul 30, 2012 at 12:20 PM, Tino Dai <oberoc at gmail.com> wrote:
> > Yes, but that would involve surrounding the entire method with a try
> except
> > finally block. I was
> > told by the Python-Guru-In Residence that shouldn't emulate Java code in
> > Python, and that was
> > generally bad programming practice (no flame war intended)
>
> It is true that you should use the idioms of each language in their
> domain. That doesn't mean you should ignore language features
> entirely. Wrapping everything in a single try/finally to handle this
> exception is as intended and not emulating the Java style of wrapping
> everything everywhere (be that good or bad).
>
>
I just remember that there was a performance hit or something for doing
that.
Does that sound familiar to anyone?
> --
> Brett Ritter / SwiftOne
> swiftone at swiftone.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120730/f8ba9018/attachment.html>
More information about the Tutor
mailing list