This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients ncoghlan, rhettinger, serhiy.storchaka
Date 2021-07-10.10:27:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625912843.83.0.51279172293.issue43838@roundup.psfhosted.org>
In-reply-to
Content
I stumbled across this independently in bpo-44596, but missed this existing report due to the specific word I was looking for (encapsulation).

In addition to the comparison operand coercion, there's now another access option through the `__ror__` method.

The bug in both cases arises from delegating a method/function implementation to the underlying mapping type in a way that invokes the full operand coercion dance. (PyObject_RichCompare in one case, PyNumber_Or in the other)

Delegating these operations to the underlying mapping does make sense, but it needs to be a lower level delegation that bypasses the operand coercion dance, so the other operand only ever sees the proxy object, not the underlying mapping.
History
Date User Action Args
2021-07-10 10:27:23ncoghlansetrecipients: + ncoghlan, rhettinger, serhiy.storchaka
2021-07-10 10:27:23ncoghlansetmessageid: <1625912843.83.0.51279172293.issue43838@roundup.psfhosted.org>
2021-07-10 10:27:23ncoghlanlinkissue43838 messages
2021-07-10 10:27:23ncoghlancreate