Where I do ask for a new feature

Michael Torrie torriem at gmail.com
Fri Oct 20 14:48:30 EDT 2023


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."


More information about the Python-list mailing list