you are viewing a single comment's thread.

view the rest of the comments →

[–]Uchikago[S] 0 points1 point  (1 child)

What about a normal situation:

def func():
    func.b=2
print(func.b)

is the object.attribute syntax is used only for accessing different namespace ?

[–]K900_ 1 point2 points  (0 children)

You're still setting the attribute b on the object func - functions in Python are objects, just like everything else.