I am currently working on a introductory project for kivy. I got an error while trying to understand the concept by playing around with the codes. I would like to know what is the difference between the 2 codes below. Thank you.
Orginal:
sm = WindowManager(),
sm.current = "second"
Current:
WindowsManager().current = "second"
method 1: you create a WindowManager instance and call it sm, then you assign the attribute current with "second".
method 2: you create a temp WindowManager instance and assign the attribute current with "second". Then the temp instance will be removed by garbage collection. (i.e. nothing really happens.)
Difference in instantiating a Class in Python