What's the best way to minimize the need of run time checks?

BartC bc at freeuk.com
Fri Aug 12 05:58:31 EDT 2016


On 12/08/2016 10:45, Chris Angelico wrote:
> On Fri, Aug 12, 2016 at 7:38 PM, BartC <bc at freeuk.com> wrote:
>> You can be too dynamic. Take an example like this:

>>  d.yaer=1999
>>
>>  print (d.day,d.month,d.year)

>> This would never get past a static language nor some that also have dynamic
>> types.
>
> Nor will it get past a lot of linters. Or unit tests. There are other solutions.

How would a linter know that you didn't /want/ to create a new attribute 
called 'yaer'?

And unit tests (which I only vaguely know about) I don't think are 
universally used. People like to use dynamic languages to code rapidly 
and informally.

-- 
Bartc




More information about the Python-list mailing list