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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:29:06+00:00 2026-05-31T21:29:06+00:00

I have a small Python OOP program in which 2 class, Flan and Outil

  • 0

I have a small Python OOP program in which 2 class, Flan and Outil inherit from a superclass Part.
My problem is when I call Flan everything works perfectly, however when I call Outil the program fails silently.
The Outil instance is created, but it lacks all the attributes it doesn’t share with Part.
The Outil instance isn’t added to Outil.list_instance_outils, nor to Part.list_instances.

class Outil(Part):

    list_instance_outils = []    

    def __init___(self, name, part_type, nodes, elems):
        Part.__init__(self, name, part_type, nodes, elems)
        self.vect_norm = vectnorm(self.nodes[self.elems[0,1:]-1, 1:])
        self.elset = Elset(self)
        self.nset = Nset(self, refpoint=True, generate=False)
        self.SPOS = Ab_surface(self, self.elset)
        self.SNEG = Ab_surface(self, self.elset, type_surf='SNEG')
        Outil.list_instance_outils.append(self)
        Part.list_instances.append(self)

class Flan(Part):

    list_instances_flans = []    

    def __init__(self, name, part_type, nodes, elems):
        Part.__init__(self, name, part_type, nodes, elems)       
        self.vect_norm = vectnorm(self.nodes[self.elems[0,1:4]-1, 1:])
        self.elset = Elset(self)
        self.nset = Nset(self)
        self.SPOS = Ab_surface(self, self.elset)
        self.SNEG = Ab_surface(self, self.elset, type_surf='SNEG')
        Flan.list_instances_flans.append(self)        
        Part.list_instances.append(self)

Both this Classes inherit from Part :

class Part():

    list_instances = []

    def __init__(self, name, part_type, nodes, elems):
        self.name = name
        self.name_instance = self.name + '-1'
        self.part_type = part_type
        self.elems = elems
        self.nodes = nodes
        offset = np.min(self.elems[:, 1:])-1
        self.nodes[:, 0] -= offset
        self.elems[:, 1:] -= offset

I cannot stress enough that I have no error message whatsoever.
What am I doing wrong here ?

  • 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-31T21:29:08+00:00Added an answer on May 31, 2026 at 9:29 pm

    You wrote __init__ with three trailing underscores instead of two in Outil.

    Because of this, it doesn’t get called — Part.__init__ gets called instead. That’s why the class is created but it lacks the attributes beyond what are in Part.

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

Sidebar

Related Questions

I have a small Python program, which uses a Google Maps API secret key.
I have a small Python program consisting of very few modules (about 4 or
I have a small python cgi script that accepts an image upload from the
I have write a small python module with one class and two functions. The
I have a small python script which serves as a configuration file. The structure
I have a small database which is legacy from an almost defunct project. This
I have a small python script which invokes an external process using subprocess .
Requirements : I have a Python project which parses data feeds from multiple sources
I am learning OOP with python .trying with small console application Stock class Stock(object):
I have a small python program I wrote for a friend, one of the

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.