This was considered as bugfix in python 3.8 because bound methods should only be equal if they are bound on the same instance, not if their instances are equal. In Python <= 3.7 the bound method equality calls the equivalent of instance1 == instance2 and return true based on that and while in Python 3.8 it checks if instance1 is instance2.
We should modify the test to test the behaviors this way and in is_same_callback() method we should clearly document that 'strict' is no more an option or valid thing for python3.8 onwards and we should even deprecate this arg itself.
This was considered as bugfix in python 3.8 because bound methods should only be equal if they are bound on the same instance, not if their instances are equal. In Python <= 3.7 the bound method equality calls the equivalent of instance1 == instance2 and return true based on that and while in Python 3.8 it checks if instance1 is instance2.
You can see details about this behavior change in py3.8 /bugs.python. org/issue161716 1 /mail.python. org/pipermail/ python- dev/2018- June/153959. html
- https:/
- python-dev discussion: https:/
With that and for cases of 'strict=False', oslo utils is_same_callback() method behaviour also changed. With 'strict=False', this method returned *True* for python <3.7 (because == comparison used to call the __eq__ method return value) and *False* for python3.8 onwards (because == never call __eq__ method and check the id of self). /github. com/openstack/ oslo.utils/ blob/7c4a94c0c3 fcbd8f055419448 51728f30deadd9b /oslo_utils/ reflection. py#L172- L174
-https:/
For 'strict' is True (which is the default) there is no behavior change because is_same_callback() method checks if 'self' of both bound methods are equal or not /github. com/openstack/ oslo.utils/ blob/7c4a94c0c3 fcbd8f055419448 51728f30deadd9b /oslo_utils/ reflection. py#L183
- https:/
We should modify the test to test the behaviors this way and in is_same_callback() method we should clearly document that 'strict' is no more an option or valid thing for python3.8 onwards and we should even deprecate this arg itself.