[ovs-dev] [unixctl_py 5/6] python: Add ovs_error() helper function to Python.
Reid Price
reid at nicira.com
Mon Mar 5 05:23:50 UTC 2012
One other note, are you deliberately allowing None (along with other python
expressions that are False as booleans) to equate to a 0 return code? You
may just want to check for integer type at the beginning of the function,
since
things compare across type without error (for error-free sorting purposes,
ostensibly). E.g.:
{1: 2} > 0 == True
"string" > 0 == True
Some things will throw TypeErrors for the >0, like sets and complex numbers.
-Reid
On Thu, Mar 1, 2012 at 5:40 PM, Ethan Jackson <ethan at nicira.com> wrote:
> > In the final case in ovs_retval_to_string(), I think I'd use %s
> > instead of %d: maybe some non-integer value got passed in and my
> > instinct is that it's probably better to convert it to a string than
> > to throw an exception.
>
> Sounds good, I've folded the change in.
>
> Ethan
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20120304/68fde767/attachment-0003.html>
More information about the dev
mailing list