Python Forum
changing value and rerunning the code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
changing value and rerunning the code
#4
Instead of if_over inheriting from all three other classes, it should only inherit from Third, which in turn extends Second, which then extends First.

The reasoning being that Second uses self.x, which is only defined in First, and Third uses self.z, which is only defined in Second. So those classes should extend from what they need, so they can be used by themselves. Your code, as it is, will never work if you try to create an object of any class EXCEPT if_over. Ideally, each piece of the chain will work, and the next piece adds more, instead of the bottom piece being the only usable one.
Reply


Messages In This Thread
RE: changing value and rerunning the code - by nilamo - Jan-18-2018, 07:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Code changing rder of headers Led_Zeppelin 0 949 Jul-13-2022, 05:38 PM
Last Post: Led_Zeppelin
  Changing a string value to a numerical value using python code and a lamda function Led_Zeppelin 6 1,738 Jul-05-2022, 11:29 PM
Last Post: deanhystad
  changing code to work on a batch of images within a folder Afrodizzyjack 2 2,144 May-12-2020, 08:56 PM
Last Post: Afrodizzyjack

Forum Jump:

User Panel Messages

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