Is this valid in Python and why? Technology Community › Category: Python › Is this valid in Python and why? 0 Vote Up Vote Down VietMX Staff asked 4 years ago Problem Consider: def my_function(): print my_function.what my_function.what = "right?" my_function() # Prints "right?" It is valid. In Python, everything is an object, including functions. But if we don’t have what defined, we will get an Attribute error.