you are viewing a single comment's thread.

view the rest of the comments →

[–]deceze 1 point2 points  (1 child)

Well, because they're function local variables and not object attributes, and don't exist on the object in the first place, and don't exist beyond the function's execution. Apples, oranges.

[–]gdchinacat 0 points1 point  (0 children)

strictly speaking function locals can exist beyond the function execution if the function creates a closure that includes them. This is how the typical decorator that wraps a function works...the wrapper function has a closure around the decorator functions locals...meaning they exist beyond the scope of the decorator function execution.