New submission from Q <abon...@gmail.com>: $python Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 >>> class Old: pass >>> class New(object): pass >>> o = Old() >>> n = New() >>> isinstance(o, object) True
This is it, basically. Is it a bug or a feature? More tests : >>> isinstance(o, Old) True >>> isinstance(o, New) False >>> isinstance(n, Old) False >>> isinstance(o, int) False Please note that some unimportant output was deleted from above. PS. If this is a feature, how do I detect an old-style class then ? ---------- components: Interpreter Core messages: 159351 nosy: thread13 priority: normal severity: normal status: open title: isinstance(obj, object) returns True for _old style_ classes type: behavior versions: Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14671> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com