Python Forum
Calling a base class variable from an inherited class
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling a base class variable from an inherited class
#2
You have to have your init call the base class init.

class Player(Generic_Player):

    def __init__(self, name):
        super().__init__()
        self.name = name
Gribouillis likes this post
Reply


Messages In This Thread
RE: Calling a base class variable from an inherited class - by bowlofred - Jan-19-2022, 06:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  class Blockage not projecting Azdaghost 1 494 May-15-2025, 04:32 PM
Last Post: deanhystad
  Return a string or byte object from Enum class? Calab 5 819 May-14-2025, 05:21 PM
Last Post: snippsat
  Python inner classes inheritance from parent class Abedin 8 1,392 Apr-23-2025, 05:56 AM
Last Post: Gribouillis
  Accessing method attributes of python class Abedin 6 1,422 Apr-14-2025, 07:02 AM
Last Post: buran
  Python class members based on a type value voidtrance 7 1,568 Apr-11-2025, 10:10 PM
Last Post: deanhystad
  Create a new subclass in a Python extension based on an existing class voidtrance 6 1,696 Mar-25-2025, 06:37 PM
Last Post: voidtrance
  printing/out put issue with class arabuamir 3 1,176 Aug-25-2024, 09:29 AM
Last Post: arabuamir
  Class test : good way to split methods into several files paul18fr 5 4,315 Jul-17-2024, 11:12 AM
Last Post: felixandrea
  [split] Class and methods ebn852_pan 15 3,769 May-23-2024, 11:57 PM
Last Post: ebn852_pan
  [SOLVED] [listbox] Feed it with dict passed to class? Winfried 3 1,449 May-13-2024, 05:57 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020