Bounds checking

Katie T katie at coderstack.co.uk
Fri Mar 18 13:42:29 EDT 2011


On Fri, Mar 18, 2011 at 3:01 PM, Jean-Michel Pichavant <
jeanmichel at sequans.com> wrote:
>
> Don't check for bounds, fix any bug in the code that would set your values
> out of bounds and use asserts while debugging.
>
> Otherwise if you really need dynamic checks, it will cost you cpu, for
> sure. Howeverver you could for instance override the __setatttr__ of state
> object, and call the attribute's associated function.
>

If the codes something critical (i.e. it's used for financial calculations,
hardware control, etc.) it's probably safer to test it dynamically, unless
you only have a finite number of inputs/outputs it's often hard to ensure
you've fixed all the bugs.

Katie
-- 
CoderStack
h <http://www.coderstack.co.uk>ttp://www.coderstack.co.uk/perl-jobs
The Software Developer Job Board
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110318/cc1f8580/attachment-0001.html>


More information about the Python-list mailing list