[docs] classes in csv module example code do not inherit from object

Sandro Tosi sandro.tosi at gmail.com
Sat Jan 21 11:33:46 CET 2012

Hello Darren,
thanks for your email.

On Fri, Jan 20, 2012 at 05:40, Darren Yin <darren.yin at gmail.com> wrote:
> http://docs.python.org/library/csv.html
> at the very bottom, perhaps UTF8Recorder, UnicodeReader, and UnicodeWriter
> should all inherit from object?

What you're suggesting is making them new-style classes. In 2.7 the
classes are, by default, old-style classes and only with 3.x Python
version the new-style classes are the only way to define a class. You
can look more at
http://docs.python.org/reference/datamodel.html#newstyle . So the
syntax used in the example is fine and I think it doesn't need to
define a new-style class for an example.

Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

More information about the docs mailing list