What is a type error?

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Jul 11 04:57:54 EDT 2006


Chris Smith <cdsmith at twu.net> writes:

>> No what happens if right here you code
>>    b := 16;
>> 
>> Does that again change the type of "b"? Or is that an illegal 
>> instruction, because "b" has the "local type" of (18..22)?
>
> It arranges that the expression "b" after that line (barring further 
> changes) has type int{16..16}, which would make the later call to 
> signContract illegal.

The assignment might be performed in a function called there, so it's
not visible locally.

Propagating constraints from conditionals is not applicable to mutable
variables, at least not easily.

I think that constant bounds are not very useful at all. Most ranges
are not known statically, e.g. a variable can span the size of an
array.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/



More information about the Python-list mailing list