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 6147663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:08:31+00:00 2026-05-23T19:08:31+00:00

Is non-virtual inheritance possible in Python, or do I have to use composition? I

  • 0

Is non-virtual inheritance possible in Python, or do I have to use composition?

I would like to call methods against an individual instance of the base class for each subclass rather than a single one for all subclasses.

Update Example:

  • Class A has an list in it.
  • Class B and C are sublasses of A
  • B and C add things to A’s list.
  • B and C’s items are both in a single list in a single A object.
  • I want B and C to have there own A, and hence their own A.list.
  • 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-05-23T19:08:34+00:00Added an answer on May 23, 2026 at 7:08 pm

    In Python, there is no separate instance of a base class if the base class is inherited multiple times. I don’t believe it’s possible to achieve what you’re asking using inheritance. Composition should work fine though.

    P.S. Your question is phrased in a rather cryptic manner (using C++ terminology for a purely Python question), but I think I understood it. If I didn’t, my apologies.

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

Sidebar

Related Questions

how exactly I can use public methods (non-virtual) with NHibernate? I have this code:
Possible Duplicate: Why C# implements methods as non-virtual by default? I'm speaking primarily about
The non-virtual interface idiom describes how the virtual methods are nonpublic customisation points, and
Unlike Java, why does C# treat methods as non-virtual functions by default? Is it
I have a virtual class that has been derived from a non virtual class.
I want to call a member function which is virtual (inheritance is used in
It is well-known that STL classes do not use virtual methods anywhere (and STL
When overriding a non-virtual method in Java, use of the @Override annotation is recommended,
In C# (.NET) how exactly methods (virtual, static, non-virtual) impact on class size?
Possible Duplicate: gcc c++ virtual inheritance problem Hi All, I am reading Effective C++

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.