Question About When Objects Are Destroyed

gst g.starck at gmail.com
Fri Aug 4 19:34:51 EDT 2017


'two' is a so called constant or literal value .. (of that function).

Why not attach it, as a const value/object, to the function itself ? So that a new string object has not to be created each time the function is called. Because anyway strings are immutable. So what would be the point to recreate such object every time the function is called ?



More information about the Python-list mailing list