"no variable or argument declarations are necessary."
Christophe
chris.cavalaria at free.fr
Fri Oct 7 07:08:27 EDT 2005
Fredrik Lundh a écrit :
> "Christophe" wrote:
>
>
>>It's more of a "Nearly too late" type checking I would say. Not that I
>>complain but it would be great if there were also some automatic type
>>checking to catch a few errors as soon as possible.
>
>
> use assert as the soonest possible point. implementing "type gates" is
> trivial, if you think you need them.
Still, it would be great if there were also some automatic type checking
in place. Using assert is hardly automatic and non intrusive.
I mean, why not ? Why does the compiler let me do that when you know
perfectly that that code is incorrect :
def f():
return "a" + 5
Of course the system can't be perfect but it doesn't need to be. It
doesn't need to constrain us in any way but if it can detect some errors
early, then it is worth it.
More information about the Python-list
mailing list