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
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.)
The current implementation for checking reversible operators contains two kludges that seem to be related to operators, metaclasses, and Type[...]
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 callinganalyze_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 anassert 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
...For additional context, see #5136 and #1806.
The text was updated successfully, but these errors were encountered: