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

  • Home
  • SEARCH
  • 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 819837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:22:32+00:00 2026-05-15T02:22:32+00:00

I am trying to do the following in a bit of python code: class

  • 0

I am trying to do the following in a bit of python code:

class Parent:
    class Child(Parent):
        pass

And it does not work. Is there any python syntax I can use to achieve the same result?

Thanks.

  • 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-15T02:22:32+00:00Added an answer on May 15, 2026 at 2:22 am

    You can’t do that because at the point where Child is being defined, Parent is not defined yet (definition in progress). Nested classes are not usually used in Python, you can just declare different classes in the same module. However, if you absolutely need to achieve the outlined setup, you can do this:

    class Parent: pass
    class Child (Parent): pass
    
    Parent.Child = Child
    del Child
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 514k
  • Answers 514k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You problem is probably session related. Are you creating and… May 16, 2026 at 6:15 pm
  • Editorial Team
    Editorial Team added an answer They do 3 different things: Int32.Parse() expects a string which… May 16, 2026 at 6:15 pm
  • Editorial Team
    Editorial Team added an answer The first thing you should do is get a tool… May 16, 2026 at 6:15 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm trying to call io_submit using python ctypes. The code I'm writing is supposed
I'm trying to resolve the following problem: [.Net 2.0, CLR 2.5.something, 64 bit machine,
Having a bit of an issue please see the following code: window.onload = function
I'm trying to get a Wrapper from NHibernate with the following code: public Wrapper
I'm trying to configure logging for a Django app using the Python logging module.
I'm trying to decode the result of the Python os.wait() function. This returns, according
Little bit confused... I am trying to track mailto links being clicked, but constantly
I am trying to align jquery ui-icons with text like following, but I notice
I'm trying to get the values from multiple textboxes using JQuery. I'm a bit
Alright, I'm just trying to learn about using Contact information, but I'm a bit

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.