[Baypiggies] Type checking - argument for it being bad practice?

Mark Voorhies mvoorhie at yahoo.com
Fri Oct 8 05:20:40 CEST 2010


On Thursday, October 07, 2010 07:32:18 pm Seth Friedman wrote:
> Hi Baypiggies,
> 
> I've encountered, a couple of times now, a sort of categorical "dont do
> typechecking" attitude on various blog posts and I haven't seen rationale to
> back it up.   Enough that I'm now curious: what's the deal?
> 
> So I put the question to you all, typechecking: good or bad thing?  Or
> pointless philosophical debate?

The lack of type signatures in function declarations are in line with "Python
as a rapid prototyping language" -- if you're spending a lot of lines on "gatekeeping"
a function's arguments, you might be better off in a language that does that
work for you (e.g., Java, C++, ...).  There is a similar argument for not putting
a lot of work into enforcing private variables in Python.

That said, I don't have a strong opinion on this, and I've heard the "traits" system
in the Enthought Python Distribution recommended as a way to assert more
control over the types that a function accepts.

--Mark


More information about the Baypiggies mailing list