Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sorting
#7
For frigider and aragaz, subclasa is defined outside the __init__ method but inside the class, so it is a class attribute, which is stored for later use. For the others, subclasa is defined in the __init__ method (without using self), so they are just local variables that go away after the __init__ method executes. You either need to define them as self.name = value, or move them out of the __init__ method like the other two.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
sorting - by AG17 - Jul-25-2019, 08:54 PM
RE: sorting - by ichabod801 - Jul-25-2019, 09:01 PM
RE: sorting - by AG17 - Jul-26-2019, 04:18 AM
RE: sorting - by DeaD_EyE - Jul-26-2019, 09:08 AM
RE: sorting - by ichabod801 - Jul-26-2019, 12:17 PM
RE: sorting - by AG17 - Jul-26-2019, 07:12 PM
RE: sorting - by ichabod801 - Jul-26-2019, 07:24 PM
RE: sorting - by liviu_dirlescu - May-04-2020, 02:09 PM

Forum Jump:

User Panel Messages

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