[Types-sig] challenge response (was: A challenge)

Skip Montanaro skip@mojam.com (Skip Montanaro)
Wed, 15 Dec 1999 23:38:18 -0600 (CST)


    Greg> Line 7: per caveat #1, assume the compiler can access the
    Greg> find.find() function. From that, it knows the signature. The first
    Greg> parameter has a matching type, but the second (PyObject) does not
    Greg> match the required type (String), so an error is raised. If caveat
    Greg> #5 is resolved, then the second parameter matches. It is also
    Greg> possible to avoid the error by rewriting:

    Greg>     list = find.find("*.py", dir!StringType)	# 7

    Greg> "list" is now a ListType, based on the find.find() return
    Greg> value. (see caveat #5 -- it could be possible to refine this
    Greg> knowledge).

I humbly assert this train of thought rates a *bzzzt*.  I thought one core
requirement was that all type declaration stuff be optional.  The worst that
the type checker/inferencer should do in the face of incomplete type info is
display a warning.  I don't think you can flag an error unless the
programmer sets some sort of PY_ANAL_TYPE_CHECKING_AND_I_REALLY_MEAN_IT
environment variable.

Skip Montanaro | http://www.mojam.com/
skip@mojam.com | http://www.musi-cal.com/
847-971-7098   | Python: Programming the way Guido indented...