On Mon, Sep 19, 2011 at 05:42:52PM -0700, Ethan Jackson wrote:
> I'm not sure that the _Serializer object is really adding much here.
> It's nice to split up the logic into several functions, but that could
> be done as nested definitions in the to_stream() function.  I think
> you would simply need to implement _serialize_string() and
> _indent_line() as nested definitions.  Then you could avoid some of
> the OO boilerplate.  Plus it would be obviously clear that the only
> thing that cares about _Serializer is to_stream().
> 
> Anyways, that's a personally preference.  If you think this approach
> is better, it's probably fine.

A class seems reasonable to me.

> > +SPACES_PER_LEVEL = 2
> > +
> > +class _Serializer(object):
> 
> A second newline is required above the class definition.

OK, done.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to