Re: DeprecationWarning under python 2.6
Sergey Schetinin <[email protected]> Wed, 15 Jul 2009 02:47:04 +0300
| Newsgroups | gmane.comp.python.peak |
|---|---|
| Message-ID | <[email protected]> |
On 2009-07-15, Kyle VanderBeek <[email protected]> wrote: > It seems silly to me to create duplicate code in PEAK-Rules when we can fix > it in one place for any/all subclasses of AddOn. When you say "most", it is > implied that there may be someone out there who has an AddOn that also > redefines __new__ (just as BitmapIndex does). This fix should work for all > of those classes. Even though it has nothing to do with AddOn? Try this to get the same warning: class BitmapIndex(object): def __new__(cls, *args): return super(BitmapIndex, cls).__new__(cls, *args) def __init__(self, *args): pass BitmapIndex(1) > Actually, I just noticed that peak.util.addons.Registry is a descendant of > AddOn that redefines __new__ as well, and uses super(). It'll have similar > problems if we don't fix it down at the AddOn level as I've proposed. It will not, as it doesn't pass any arguments to super().__new__