[issue23967] Make inspect.signature expression evaluation more powerful
Serhiy Storchaka
report at bugs.python.org
Thu Apr 23 10:49:52 CEST 2015
Serhiy Storchaka added the comment:
Using complex expressions is deceitful. In Python functions the default value is evaluated only once, at function creation time, but inspect.signature will evaluate it every time. For example foo(x={}) and foo(x=dict()) means the same in function declaration, but different in signature.
It could also affect security, because allow arbitrary code execution at the place where it was not allowed before.
I think this issue should be discussed on Python-Dev. I'm not sure that it is pythonic.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23967>
_______________________________________
More information about the Python-bugs-list
mailing list