problem with hack using multiple inheritance for plugins

Thomas Jollans thomas at jollans.com
Thu Jun 28 08:56:45 EDT 2007


massimo s. wrote:
> On 28 Giu, 13:45, Bruno Desthuilliers <bruno.
> 42.desthuilli... at wtf.websiteburo.oops.com> wrote:
>> massimo s. a écrit :
>>
>>>> At this point, it seems too much a deep object-oriented hell to be
>>>> able to dig it myself. Would you help me getting some cue on the
>>>> problem?
>>> Update. Now I know that:
>>> - every sane Python class should return <type 'instance'> after
>>> type(self)
>> Certainly not, unless you're using a pretty old Python version.
>> 'instance' type means old-style classes - the legacy Python object
>> model, replaced some years ago with a *much* better one ('new-style'
>> classes). IIRC, this (now dying) legacy object model should disappear
>> with Py3K.
> 
> Oops. That's probably the problem.
> 
> I always followed the class syntax found in Section 9 of the tutorial,
> and Python code I've seen uses the same syntax.
> 
> Where can I find the syntax of new-style classes?

syntax is the same. A class is new-style if it inherits from at least
one new-style class and zero or more old-style classes. If you're not
really inheriting, inherit from object, which is a new-style class that
does nothing.

see
http://wiki.python.org/moin/NewClassVsClassicClass


Thomas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20070628/e30223d0/attachment.sig>


More information about the Python-list mailing list