[PyQt] Exceptions in Python Implementations of Virtuals

Chris Colbert sccolbert at gmail.com
Tue Sep 30 18:51:42 BST 2014


On Tue, Sep 30, 2014 at 1:24 PM, Phil Thompson <phil at riverbankcomputing.com>
wrote:

> On 30/09/2014 5:52 pm, Chris Colbert wrote:
>
>> I'm strongly -1 on this.
>>
>> I think exceptions should be handled consistently throughout the library.
>>
>
> I agree, but they aren't at the moment.
>
>  So if you were to make this change for virtual functions, it should also
>> be
>> made for signal handlers.
>>
>
> Agreed.
>
>  But, user code excepting on the path of a signal
>> handler or a virtual event method is very common in my experience, and not
>> all of these exceptions prohibit the app from continuing to function.
>>
>
> If I get them I consider them a bug in my application.


I do as well.


>
>
>  Fataling the app, on the other hand, would lead to absolute mayhem on the
>> production floor.
>>
>> Imagine a case where a finance app developer misspells some attribute like
>> palette and has insufficient test coverage. Crashing the app in the middle
>> of trade execution is a much worse outcome than failing to color the line
>> edit correctly.
>>
>
> Let me paraphrase what you just said...
>
> An application spends my money. It hasn't been tested. If it has bugs I
> don't want to know about them.
>
>
That's not what I meant. I responded on my phone so tried to keep it as
short as possible. What I was trying to get across was:

In any sufficiently large organization, you will find developers which lack
the discipline to properly test their code. It's certainly not ideal, but
that's just the reality. I would much rather be able to point to exceptions
in a log file than be woken up at 2am because the trading desk just crashed
and wont restart due to a bad commit.

There are controls in place to ensure consistency of trade details. Being
able to limp along is better than not being able to run the app at all.

Again, not saying it's ideal, but I also can't baby-sit a team of thousands
of developers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140930/664c2f1c/attachment.html>


More information about the PyQt mailing list