super, object and type?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ssecorp

    super, object and type?

    >>super(objec t, type)
    <super: <class 'object'>, <type object>>
    >>super(type, object)
    <super: <class 'type'>, <type object>>
    >>>
    how can both work?

    they can't both be the superclass of each other right? or is it some
    sort of mutually recursive definition?



    >>help(object )
    Help on class object in module __builtin__:

    class object
    | The most base type
    >>help(type)
    Help on class type in module __builtin__:

    class type(object)
    | type(object) -the object's type
    | type(name, bases, dict) -a new type
  • Calvin Spealman

    #2
    Re: super, object and type?

    object and type both are instances of type. Yes, type is an instance of itself.

    type inherits object.

    On Tue, Aug 12, 2008 at 1:14 PM, ssecorp <circularfunc@g mail.comwrote:
    >>>super(object , type)
    <super: <class 'object'>, <type object>>
    >>>super(type , object)
    <super: <class 'type'>, <type object>>
    >>>>
    >
    how can both work?
    >
    they can't both be the superclass of each other right? or is it some
    sort of mutually recursive definition?
    >
    >
    >
    >
    >>>help(objec t)
    Help on class object in module __builtin__:
    >
    class object
    | The most base type
    >
    >>>help(type)
    Help on class type in module __builtin__:
    >
    class type(object)
    | type(object) -the object's type
    | type(name, bases, dict) -a new type
    --

    >


    --
    Read my blog! I depend on your acceptance of my opinion! I am interesting!

    Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy

    Comment

    Working...