Potential pitfalls when going from old-style to new-style classes
Skip Montanaro
skip.montanaro at gmail.com
Wed Nov 19 14:14:59 EST 2014
More information about the Python-list mailing list
Wed Nov 19 14:14:59 EST 2014
- Previous message (by thread): ANN: eGenix mxODBC Connect 2.1.1 - Python Database Interface
- Next message (by thread): Potential pitfalls when going from old-style to new-style classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): ANN: eGenix mxODBC Connect 2.1.1 - Python Database Interface
- Next message (by thread): Potential pitfalls when going from old-style to new-style classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list