Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:29:39+00:00 2026-06-03T10:29:39+00:00

According to the doc, object is all new-style classes’ base class. And AFAIK, the

  • 0

According to the doc, object is all new-style classes’ base class.

And AFAIK, the so-called new-style classes are just ones which can acquire some new fetures by inheriting object, right?

I thought object inherit type or use type as its __metaclass__, but object.__bases__ gives me nothing, so where dose this object come from, and what’s relationship bewteen it and type?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:29:40+00:00Added an answer on June 3, 2026 at 10:29 am

    Indeed, the type (i.e., metaclass) of object, a class, is type:

    type(object) == type      # True
    

    And since object is the base class, it has no parents of its own, as you’d expect:

    object.__bases__ == ()    # True
    

    object doesn’t have a __metaclass__ attribute because it doesn’t need one: it uses the default metaclass, type.

    Now it’s a little confusing because type is in fact a subclass of object, which boggles the mind (how can type be derived from object when you need type to construct object?) but this is solved by a little hard-coding at the C level in the Python interpreter.

    All this applies only to new-style classes, that is, those derived from object. In Python 3, all classes are new-style, so this applies globally in Python 3.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new to QML. According to the QML documentation at http://doc.qt.nokia.com/4.7-snapshot/qdeclarativescope.html , the
According to the doc, the 'error' ajax event gets passed the XMLHttpRequest object, 'success'
According the Wordpress' doc, when we create theme, we need to create style.css file
According to the class ElementType in the API, you can annotate local variables and
According to a doc Emacs supports drag and drop: dropping a file into an
I'm using gem rapns (https://github.com/ileitch/rapns) on my rails app. According to rapns doc, I
According to mongodb doc, syntax for $elemMatch would be, t.find( { x : {
According to Apple's gcc 4.2.1 doc : -arch arch Compile for the specified target
According to doc and various answers here git difftool will invoke the specified executable
According to doc, calendar set() is: http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html#set%28int,%20int,%20int%29 set(int year, int month, int date) Sets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.