duck-type-checking?

Steve Holden steve at holdenweb.com
Fri Nov 14 00:19:34 CET 2008


Craig Allen wrote:
>> since both are equally informative when it comes to tracing the faulty
>> assignment.
>>
> 
> steve, they are not equally informative, the assertion is designed to
> fire earlier in the process, and therefore before much mischief and
> corruption can be done compared to later, when you happen to hit the
> missing attribute.

I disagree. The assertion may fire a few lines before the non-existent
attribute access, but typically the damage is done in an assignment
before the function that raises the error is even called.

And I therefore suspect that a whole load of heavyweight type-checking
will be done for no very good reason.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list