Find answers, ask questions, and connect with our <br>community around the world.

  • Posted by Raghu Karthik on December 17, 2023 at 3:16 pm

    hi,

    when deleting an object why is the variable other than self passed into __del__ along with self. Like : can’t we just do “def__del__(self): ” instead of “def __del__(self,coefficient)”

    Rahul replied 5 months, 3 weeks ago 2 Members · 1 Reply
  • 1 Reply
  • Rahul

    Member
    December 18, 2023 at 4:22 am

    Hi Raghu,
    Please go through lessons 19 and 20 carefully, as this issue has been clearly explained. In lesson 19, you can see that the usage you have mentioned __del__(self) can be used (@03:15 min). In lesson 20, while writing the code, __del__(self, coefficient) is used, resulting in a runtime error. This is resolved by debugging and using __del__(self) instead(around the 05:10 min mark).
    In programming lessons, please watch the video carefully till the end to understand the code. The initially written code may have some syntax or logical error which will be debugged later on in the lesson. If there is any unresolved doubt once the lesson ends or there is some error please let us know.
    Warm regards
    Rahul
    Flowthermolab support

Log in to reply.

error: Content is protected !!