On Fri, Mar 18, 2011 at 3:01 PM, Jean-Michel Pichavant < jeanmic...@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
-- http://mail.python.org/mailman/listinfo/python-list