massimo s. wrote:
> On 28 Giu, 13:45, Bruno Desthuilliers <bruno.
> [EMAIL PROTECTED]> 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


Attachment: signature.asc
Description: OpenPGP digital signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to