Run enum.Enum analysis on non-assigned calls
Fixes https://github.com/python/mypy/issues/20266
semanal_enum.py generally feels kinda strange, like process_enum_call feels redundant? The only thing it adds over simply making semanal do check_enum_call is... check that we aren't assigning to a property or a tuple. I feel like we could separate that and make it somewhat nicer.
I did the minimal thing though, so I did not refactor things.
Diff from mypy_primer, showing the effect of this PR on open source code:
psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/types/enum.py:175: error: Enum() expects a string literal as the first argument [misc]
I think that error is fine. It's not clear whether we should error or not, but e.g. I can imagine a world where the returned Enum has to match a protocol (e.g. "has attribute a"). That wouldn't work right now, but the error message as stated would be correct.
(maybe others have different opinions?)
I think that error is fine. It's not clear whether we should error or not
I think the message could be worded a bit differently to clarify that this is a mypy limitation and not a runtime requirement, but the presence of this error is definitely fine - there should be some limits when we just say "nah, sorry, don't know what you mean here" and bail out