You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently code that checks access to dunder operator methods duplicates code in checkmember.py. Apart from code duplication, the code for operators is more simplistic and doesn't cover some corner cases. A similar situation is with accessing attributes for protocol checks.
The common pattern in both cases is that we need almost the same logic as in checkmember.py, but with some steps skipped and error reporting suppressed.
The text was updated successfully, but these errors were encountered:
One concrete difference is that operator methods on type objects (as opposed to instances) have different semantics -- they can't generally be defined as class/static methods (and there's __class_getitem__ in Python 3.7).
Just to add some extra details/clues: I tried removing that call in my recent operators refactor, and it ended up breaking the pythoneval.testMetaclassOpAccessAny test case to fail -- I added a TODO about this to the relevant section of the code.
Currently code that checks access to dunder operator methods duplicates code in
checkmember.py
. Apart from code duplication, the code for operators is more simplistic and doesn't cover some corner cases. A similar situation is with accessing attributes for protocol checks.The common pattern in both cases is that we need almost the same logic as in
checkmember.py
, but with some steps skipped and error reporting suppressed.The text was updated successfully, but these errors were encountered: