Bounds checking

Martin De Kauwe mdekauwe at gmail.com
Sat Mar 19 04:30:31 EDT 2011


> dir() has to do a bit a computation. I would be tempted to give 'state'
> a set of attributes to check. Call it 'nonnegatives'.
>     for attr in nonnegatives:
>        if ...
>
> This allows for attributes not subject to that check.
>
> --
> Terry Jan Reedy

Agreed. I was trying to just write a dummy example quickly to go with
my question and that was just the way that came to mind so that I
could loop over them to test. It wasn't a great example sorry! In
reality I would just have like you said a subset a list I guess of the
ones I would check.



More information about the Python-list mailing list