20 Sep
2009
20 Sep
'09
2:34 a.m.
Dj Gilcrease wrote:
I think of what I am trying to accomplish as an easier way of having syntax for type checking that does not involve having to do isinstance or hasattr checks in every place you want to validate the type.
A potential problem with this is that if you make it *too* easy to write type checks, you're likely to end up with inefficiencies due to types being checked a lot more often than they really need to be. There's a school of thought that expensive operations shouldn't be hidden behind syntax that makes them appear deceptively cheap. On that basis, since there is some cost to doing a type check, it could be argued that you should have to do a bit of work in order to write one. -- Greg