You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which involves creation and destruction of a new Container instance (the __del__ method is called). I don't really understand why one can't just do p[0].value = 5.
In contrast, print(p[0].value) is supported and does not involve creation and destruction of a new Container instance (__del__ is not called).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
If I understand correctly, to modify the value pointed by a pointer, one needs to run:
which involves creation and destruction of a new
Container
instance (the__del__
method is called). I don't really understand why one can't just dop[0].value = 5
.In contrast,
print(p[0].value)
is supported and does not involve creation and destruction of a newContainer
instance (__del__
is not called).Beta Was this translation helpful? Give feedback.
All reactions