Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81037 > unrolled thread

Potential pitfalls when going from old-style to new-style classes

Started bySkip Montanaro <skip.montanaro@gmail.com>
First post2014-11-19 13:14 -0600
Last post2014-11-19 13:14 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Potential pitfalls when going from old-style to new-style classes Skip Montanaro <skip.montanaro@gmail.com> - 2014-11-19 13:14 -0600

#81037 — Potential pitfalls when going from old-style to new-style classes

FromSkip Montanaro <skip.montanaro@gmail.com>
Date2014-11-19 13:14 -0600
SubjectPotential pitfalls when going from old-style to new-style classes
Message-ID<mailman.15997.1416424509.18130.python-list@python.org>
I discussion on the code-quality list got me thinking. Suppose I have
an old-style class in a 2.x app:

class Foo:
  def __init__(self):
    blah blah blah

I still use 2.x exclusively, but anytime I run pylint over a bit of
code and it complains that Foo is old-school, I make the obvious
change to inherit from object. While I do this mostly to shut up
pylint so I can focus on more serious messages, I must admit I have
never experienced any problem changing from old-style to new-style
classes. Under what circumstances might this be problematic?

Thx,

Skip

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web