On Wed, May 22, 2013 at 05:50:24PM -0700, Reid Price wrote:
> On Wed, May 22, 2013 at 4:48 PM, Ben Pfaff <b...@nicira.com> wrote:
> >                 if not m:
> >                      fatal("%s: syntax error in destination" % dst)
> >
> Usually I find %r easier to debug with, so you can see funny characters
> clearly.
>  "%r" % (dst, )
> is equivalent to
>  "%s" % (repr(dst), )

OK, fair enough, I made that change.

> >                  if m.group(3):
> >                      code = int(m.group(3))
> >                  else:
> >                      code = None
> >
> The current form is fine.  You could make it shorter, but I don't like that
> the user
> would have to know that m.group(X) returns None
>   code = m.group(4) and int(m.group(4))

I think I'll leave this as-is, then.  I'll keep this trick in mind for
the future though.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to