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
{{ message }}
Repository navigation
Clean up kludges for handling metaclasses and Type[...] in check_op_reversible #5491
This call to has_member feels like it ought to be unnecessary/redundant due to the following analyze_member_access -- but removing it causes pythoneval's OpMetaclassAccess test case to fail.
(Note: if you remove just that call, you also need to add in a elif isinstance(member, AnyTyp): return None after calling analyze_member_access)
If the reversible operators logic was unable to find a matching operator, it just tries calling check_call on the name directly to get back some generic error message. It seems as if this call ought to always return an error message, but sometimes it surprisingly will not. E.g. see the TypeTypeComparisonWorks tests in check-classes -- adding an assert local_errors.is_errors() causes that test case to crash.
This feels related to the first TODO in some way -- either we're not handling operators + metaclasses + Type directly, or there are some weird shenanigans happening due to Any...
(I added myself mostly out of a sense of obligation, since the TODOs were a fallout of my operator refactors. But I also don't know when I'll find the time to do this, so feel free to tackle this whenever.)
Activity
elazarg commentedon Aug 17, 2018
I should work on this, if I will find the time.
Michael0x2a commentedon Aug 17, 2018
@elazarg -- sounds good to me!
(I added myself mostly out of a sense of obligation, since the TODOs were a fallout of my operator refactors. But I also don't know when I'll find the time to do this, so feel free to tackle this whenever.)
elazarg commentedon Sep 16, 2018
@Michael0x2a - sorry, I can't seem to find the time to do that.
Michael0x2a commentedon Sep 19, 2018
@elazarg -- no worries, I'm also in the same boat.
Clean-up and move operator access to checkmember.py (python#19250)