[issue21130] equivalent functools.partial instances should compare equal

Raymond Hettinger report at bugs.python.org
Wed Apr 2 22:19:09 CEST 2014


Raymond Hettinger added the comment:

What is the use case?

What would be the criteria for comparing functions?  Would the func_name have to match?  Would the func_defaults have to match?  Would the f.__code__.co_names have to match (the internal variable names?  Do the function attributes in f.__dict__ have to match?  Does the func.__doc__ have to match?

The problem is that functions are complex objects and the equivalence criteria means different things to different people.  In the absence of a clear spec that makes sense to most people, object identity is the only sure definition of equivalence.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21130>
_______________________________________


More information about the Python-bugs-list mailing list