How do you find what exceptions a class can throw?

Julio Di Egidio julio at diegidio.name
Sun Dec 20 14:14:24 EST 2020


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. 
> > 
> > <https://docs.python.org/3.8/library/socket.html#socket.timeout> 
> > 
> > Programmers don't guess...
> 
> I did not suggest guessing. 

Yes, you did.  :)

> I suggested gathering scientific evidence by 
> running a controlled experiment.

Programming is not a science: in fact, computer science is a mathematics, and engineering is engineering.

Rather (speaking generally), the "trial and error" together with "not reading the docs" is a typical beginner's mistake.

> Or should I say "Programmers don't trust..." ? 

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...

Julio


More information about the Python-list mailing list