Typed Python?

Ville Vainio ville at spammers.com
Tue Jul 6 14:19:00 EDT 2004


>>>>> "Paul" == Paul Prescod <paul at prescod.net> writes:

    Paul> reasons. Think about how much the semantics would have to
    Paul> change to be able to help with type correctness reliably.

Would it? Wouldn't optional type declarations combined with type
inference "elsewhere" take care of the correctness aspect as well?

def g(x):
  ...

def f(x,y) -> str:
  ...


s=g(3)

s.woohey()   # might work, no complaint

s = f(1,2)
if randomevent():
  s.woohey()     # impossible, type inference croaks
else:
  s.hjhj()       # ditto

-- 
Ville Vainio   http://tinyurl.com/2prnb



More information about the Python-list mailing list