On 10/19/23 19:32, Bongo Ferno via Python-list wrote:
> 
>> You can actually just do that with simple assignment! 
>>
>> short_view = my_object.stuff.long_stuff.sub_object 
>> print(short_view.some_method()) 
> 
> but then have to delete the variable manually
> 
> del short_view 

Why? It's just a name in the namespace that you can bind to a function
object.  You can ignore it or rebind it later to something else. There's
no need to del it, although you can. I'm not sure why you want to del
it.  It's not like a memory leak or something like that.

I suspect we might also have a misunderstanding of what python variables
are and how they work, which is why I did not use the word, "reassign"
but rather "bind" or "rebind."
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to