RE: How do you find what exceptions a class can throw?

2020-12-21 Thread Avi Gross via Python-list
: Monday, December 21, 2020 4:06 AM To: python-list@python.org Subject: Re: How do you find what exceptions a class can throw? Avi Gross wrote: > The original question sounded like someone was asking what errors > might be thrown for a routine they wrote that used other components > t

Re: How do you find what exceptions a class can throw?

2020-12-21 Thread Terry Reedy
On 12/21/2020 4:06 AM, Chris Green wrote: Avi Gross wrote: The original question sounded like someone was asking what errors might be thrown for a routine they wrote that used other components that might directly throw exceptions or called yet others, ad nauseum. OP here. The original questi

Re: How do you find what exceptions a class can throw?

2020-12-21 Thread Grant Edwards
On 2020-12-21, Chris Angelico wrote: > On Mon, Dec 21, 2020 at 1:11 PM Julio Di Egidio wrote: >> > Gathering evidence is indeed part of science, and computer science is >> > indeed mathematics, but alas programmering is just a craft and software >> > engineering often ... isn't. >> >> Programming

Re: How do you find what exceptions a class can throw?

2020-12-21 Thread Chris Angelico
On Tue, Dec 22, 2020 at 12:32 AM Larry Martell wrote: > > On Sun, Dec 20, 2020 at 9:36 PM Chris Angelico wrote: > > > > On Mon, Dec 21, 2020 at 1:11 PM Julio Di Egidio wrote: > > > > Gathering evidence is indeed part of science, and computer science is > > > > indeed mathematics, but alas progra

Re: How do you find what exceptions a class can throw?

2020-12-21 Thread Larry Martell
On Sun, Dec 20, 2020 at 9:36 PM Chris Angelico wrote: > > On Mon, Dec 21, 2020 at 1:11 PM Julio Di Egidio wrote: > > > Gathering evidence is indeed part of science, and computer science is > > > indeed mathematics, but alas programmering is just a craft and software > > > engineering often ... is

Re: How do you find what exceptions a class can throw?

2020-12-21 Thread Chris Green
Avi Gross wrote: > The original question sounded like someone was asking what errors might be > thrown for a routine they wrote that used other components that might > directly throw exceptions or called yet others, ad nauseum. > OP here. The original question was because I wanted to trap timout

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread 2QdxY4RzWzUUiLuE
On 2020-12-20 at 21:46:48 -0500, Avi Gross via Python-list wrote: [...] > I would say it is a more laudable goal for each function to publish > what interrupts they do NOT handle that might come through and perhaps > why ... I'm not disagreeing. Documenting important decisions and the reasons

RE: How do you find what exceptions a class can throw?

2020-12-20 Thread Avi Gross via Python-list
The original question sounded like someone was asking what errors might be thrown for a routine they wrote that used other components that might directly throw exceptions or called yet others, ad nauseum. Some have questioned the purpose. I can well imagine that if such info was available, you co

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Chris Angelico
On Mon, Dec 21, 2020 at 1:11 PM Julio Di Egidio wrote: > > Gathering evidence is indeed part of science, and computer science is > > indeed mathematics, but alas programmering is just a craft and software > > engineering often ... isn't. > > Programming is a *discipline* It's a discipline, a scie

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Ethan Furman
On 12/20/20 6:06 PM, Julio Di Egidio wrote: You could have taken the chance to pay attention Programming is a *discipline*, while you keep echoing cheap and vile marketing nonsense. I am sure you do, rigour mortis eventually... Mean-spirited and hostile messages are not welcome on this

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Julio Di Egidio
On Sunday, 20 December 2020 at 23:16:10 UTC+1, cameron...@gmail.com wrote: > On 20Dec2020 20:34, Karsten Hilbert wrote: > >> Trust me: it takes 100x getting anything done plus keep up with your > >> prayers, and it takes 100^100x learning anything solid, as in just forget > >> about it. Indeed,

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Cameron Simpson
On 20Dec2020 20:34, Karsten Hilbert wrote: >> Trust me: it takes 100x getting anything done plus keep up with your >> prayers, and it takes 100^100x learning anything solid, as in just forget >> about it. Indeed, consider that we are rather going to the formal >> verification of programs, soft

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread 2QdxY4RzWzUUiLuE
On 2020-12-20 at 18:25:40 -, Grant Edwards wrote: > On 2020-12-20, 2qdxy4rzwzuui...@potatochowder.com > <2qdxy4rzwzuui...@potatochowder.com> wrote: > > Chris Green wrote: > > > >>> Ultimately, it is not possible to tell what exceptions > >>> a call might throw. > > While it may not be

Aw: Re: Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Karsten Hilbert
> Trust me: it takes 100x getting anything done plus keep up with your prayers, > and it takes 100^100x learning anything solid, as in just forget about it. > Indeed, consider that we are rather going to the formal verification of > programs, software, and even hardware... I sincerly wish you

Re: Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Julio Di Egidio
On Sunday, 20 December 2020 at 19:54:08 UTC+1, Karsten Hilbert wrote: > > > So what you are looking for is the form of a potential > > > "timeout exception" (say, exception name) ? > > > > > > Provoke one and have a look. > > > > > > Then catch what you saw. > > > >

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Grant Edwards
On 2020-12-20, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > Chris Green wrote: > >>> Ultimately, it is not possible to tell what exceptions >>> a call might throw. While it may not be "ultimately possible", in practice it usually is. Most libarary documen

Aw: Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Karsten Hilbert
> > So what you are looking for is the form of a potential > > "timeout exception" (say, exception name) ? > > > > Provoke one and have a look. > > > > Then catch what you saw. > > > > Programmers don't guess... I did not suggest gue

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >So that, as is always advised, I can catch the specific exception > >being thrown! > > It usually is advisable to be more specific when catching > exceptions. The worst thing to do is surely a bare "except:" > which then ignores the exception. >

Re: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Julio Di Egidio
On Sunday, 20 December 2020 at 19:35:21 UTC+1, Karsten Hilbert wrote: > > If it's a timeout exception I'm going to delay a little while and then > > try again. The timeout is probably because the server is busy. > > So what you are looking for is the form of a potential > "timeout exception" (s

Aw: Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Karsten Hilbert
> > Remember, you get reporting (a traceback) and program cleanup and exit > > for free. What will catching an exception *add* to the user experience? > > If it's a timeout exception I'm going to delay a little while and then > try again. The timeout is probably because the server is busy. So wh

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Chris Green
2qdxy4rzwzuui...@potatochowder.com wrote: > On 2020-12-20 at 16:02:53 +, > Regarding "Re: How do you find what exceptions a class can throw?," > Chris Green wrote: > > > Stefan Ram wrote: > > > Chris Green writes: > > > >I am using poplib.

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Julio Di Egidio
On Sunday, 20 December 2020 at 18:18:26 UTC+1, Chris Green wrote: > If I ignore the exception then the > program just exits, if I want the program to do something useful about > it (like try again) then I have to catch the specific exception as I > don't want to try again with other exceptions.

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread 2QdxY4RzWzUUiLuE
On 2020-12-20 at 16:02:53 +, Regarding "Re: How do you find what exceptions a class can throw?," Chris Green wrote: > Stefan Ram wrote: > > Chris Green writes: > > >I am using poplib.POP3_SSL() and I want to know what exceptions can be > > >thrown

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >I am using poplib.POP3_SSL() and I want to know what exceptions can be > >thrown when I instantiate it. Presumably it inherits them because > >there's nothing much in the documentation page for poplib.POP3_SSL(). > > Both Java and C++ have tried to i

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread dn via Python-list
On 20/12/2020 22:39, Chris Green wrote: I am using poplib.POP3_SSL() and I want to know what exceptions can be thrown when I instantiate it. Presumably it inherits them because there's nothing much in the documentation page for poplib.POP3_SSL(). I specifically want to trap timeout exceptions.