[Types-sig] Type checks

Greg Stein gstein@lyra.org
Wed, 29 Dec 1999 12:21:32 -0800 (PST)


On Thu, 30 Dec 1999, skaller wrote:
> Greg Stein wrote:
> > Python is also very deterministic. "Implementation-defined" really does
> > not exist.
> 
> 	I agree, more or less. There is some indeterminism with
> bitwise operators (depends on the underlying C implementation,
> which sucks :-)

If this is the case, then let Guido know. He has generally taken the pain
to ensure that cases like this just don't exist.

> > Errors in Python raise exceptions. That is how it is defined, and that is
> > the general style/pattern for the language.
> 
> 	Not true for assertions.
> And type constraints are assertions.

Stop being a nit-pick. But since you are, let me rephrase:

[In general,] errors in Python raise exceptions. [This is the pattern used
for all errors. One error, AssertionError, as raised by the "assert"
statement will not be raised by the compiler in "debug" mode, or in code
generated when optimization is enabled.]

Essentially, even the assert statement is rigidly defined. I strongly
believe that type assertions would follow the exact pattern of regular
assertions.

-g

-- 
Greg Stein, http://www.lyra.org/