[Types-sig] Conformance model
skaller
skaller@maxtal.com.au
Fri, 31 Dec 1999 06:00:59 +1100
Tim Hochberg wrote:
> First off, the function 'f' is close enough to:
>
> def g(x):
> return g + "Hello"
>
> that it strikes me as somewhat strange to ban the former but not the later.
I'd ban _anything_ that raised _any_ error, except an environment
error, unless the error was caught in the function that raises the
error.
This implies NO system exceptions can be raised by a function.
Only user defined exceptions. And they can ONLY be raised by
an explicit 'raise' statement.
This means that, when calling a function that does NOT
raise any errors, we don't have to check for them.
This is a huge overhead in typical C code, an obstacle
to inlining, which reduces one of pythons biggest performance
bottlenecks -- function calling.
--
John Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia
homepage: http://www.maxtal.com.au/~skaller
voice: 61-2-9660-0850