Typing system vs. Java
David M. Cooke
cookedm+news at physics.mcmaster.ca
Thu Aug 2 09:19:52 EDT 2001
More information about the Python-list mailing list
Thu Aug 2 09:19:52 EDT 2001
- Previous message (by thread): Typing system vs. Java
- Next message (by thread): Typing system vs. Java
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At some point, "Terry Reedy" <tjreedy at home.com> wrote: > "Donn Cave" <donn at u.washington.edu> wrote in message > news:9ka118$mj8$1 at nntp6.u.washington.edu... > > And the run time error is a TypeError: unsubscriptable object. > > He's baffled enough by this to post to comp.lang.python instead > > of figure it out himself. > > What we need here are better error messages: a more explicit 'none > object is not subscriptable' might have steered him to the problem. Or perhaps better, a compile-time error that 'parse' has an implicit 'return None' at the end. Of course, adding that would mean that this: def three_plus_1_problem(n): while 1: if n == 1: return 1 if x % 2 == 0: n = n / 2 else: n = 3*n + 1 would also be an error; you'd have to throw an extraneous return at the end. Personally, I could live with that for the extra sanity checking. -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca
- Previous message (by thread): Typing system vs. Java
- Next message (by thread): Typing system vs. Java
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list