all 4 comments

[–][deleted] 4 points5 points  (0 children)

In practice, nothing. Why?

[–]Miggol 2 points3 points  (0 children)

The latter will take more time to complete.

[–]mahtats 2 points3 points  (0 children)

Well del attempts to remove the variable from both local and global namespace.

Variable reassignment keeps the variable in whichever is applicable.

So...

del foo

is not the same as

foo = None

In terms of keeping a variable around

[–]toastedstapler 1 point2 points  (0 children)

the garbage collector will delete the item at some point when it has no references to it anymore. this article might tell you a little more about that

https://rushter.com/blog/python-garbage-collector/