In Python, functions created using def and lambda have a __dict__ attribute so you can dynamically add attributes to them. Having a __dict__ for every function has a memory cost. An empty dict uses 140 bytes in CPython 2.6.
Adding attributes to a function isn’t a particularly common thing to do, and you can use a custom object with a __call__ method for the cases where you do need a function with non-standard attributes.
Since adding custom attributes to a function isn’t a common use case and having a __dict__ has a memory cost why do Python functions have a __dict__?
PEP 232 has an extensive discussion about this, you might wanna take a look.