will python 3000 break my code?

Martijn Faassen m.faassen at vet.uu.nl
Wed Mar 1 17:43:54 EST 2000


Daniel Berlin <dan at cgsoftware.com> wrote:
[snip]

[effbot]
> 3. be impossible to identify by automatic tools.
> Tim's excellent checkappend.py can spot many
> cases, but not all.

> Actually, this isn't true (that it's impossible).
> If you really like, i'll take a few days of my spring break and write one
> guaranteed to catch every single case. 
> You can do it by looking at the byte code.
> If you are trying to call function "append" with more than 1 argument on an
> object whose type is a list, it's bad.

Are you sure you've thought this through? How would you know the
type of an object is a list? That's the tricky part, to know you're
dealing with a list and not something else that happens to have a method
'append'.

Anyway, if you can write a static typechecker for Python in a few days
during spring break the types-sig will be happy; doing this isn't *that*
much easier than writing a full fledged static typechecker, it seems to
me.

Regards,

Martijn




More information about the Python-list mailing list