dream hardware

Martin P. Hellwig xng at xs4all.nl
Tue Feb 12 17:51:42 EST 2008


Bjoern Schliessmann wrote:
> Jeff Schwab wrote:
> 
>> The only "dream hardware" I know of is the human brain.
> 
> Nah. Too few storage capacity, and too slow and error-prone at
> simple calculations. The few special but very advanced features are
> all hard-wired to custom hardware, it's a real nightmare
> interfacing with it.
> 
> Regards,
> 
> 
> Björn
> 
Yes and don't try to do a direct interface if you are not absolutely, 
certainly, 100% sure, that the understanding of the API is mutual.

If not, be prepare to handle exceptions. Some you can ignore in a 
try/except clause like SyntaxError, MemoryError, RuntimeError and 
ReferenceError.

Others should be more interpreted like a progress indication, for 
example: ArithmeticError which may be raised like a plain StandardError.

But if you are lucky and get things more or less running watch out for
LookupError, BaseException, EnvironmentError and NameError, does can 
ruin your day and may even be fatal.

Absolutely fatal are: ValueError and TypeError, nothing really you can 
do against, even if you can catch these errors the program will usually 
still halt on a SystemExit.

And if you think that is the worst can happen, he!
There is still: AttributeError, ImportError, IOError and OverflowError.

And it the end if all that didn't happen there is quite a chance either 
you or the other go for a NotImplementedError.

If that didn't happen you always get after random() time an EOFError, 
however the good thing is that the process continues due to os.fork() 
(not available on all platforms).

Don't count on return(0).

-- 
mph



More information about the Python-list mailing list