Uh oh!
There was an error while loading. Please reload this page.
Detect metaclass conflicts, refs #13563 - #13565
Conversation
This comment has been minimized.
This comment has been minimized.
Without known exceptions it generates a lot of false-positives. Let's wait for the latest mypy-primer report. |
This comment has been minimized.
This comment has been minimized.
sobolevn
commented
Aug 31, 2022
I need to fix |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Ok, looks like I found the problem:
I will address this in a separate PR. |
sobolevn
commented
Aug 31, 2022
So, basically we have a bug in mypy that was revealed by this. |
sobolevn
commented
Aug 31, 2022
Proof, I added these lines to reveal_type(AssocOp)
reveal_type(type(AssocOp))
reveal_type(AssocOp.__lt__)This project has lots of circular imports. They are everywhere:
Some of them are causing this. |
This comment has been minimized.
This comment has been minimized.
…python#13575) This diff: - Fixespython#8129 - Fixespython#13043 - Fixespython#13167 For more concise repros of these various issues, see the modified test files. But in short, there were two broad categories of errors: 1. Within the deferred pass, we tend to infer 'Any' for the types of different variables instead of the actual type. This interacts badly with our unreachable and disallow-any checks and causes spurious errors. Arguably, the better way of handling this error is to only collect errors during the final pass. I briefly experimented with this approach, but was unable to find a clean, efficient, and non-disruptive way of implementing this. So, I settled for sprinkling in a few more `not self.current_node_deferred` checks. 2. The `self.msg.disallowed_any_type(...)` call is normally guarded behind a `not self.chk.current_node_deferred` check. However, we were bypassing this check for `except` block assignments because we were deliberately setting that flag to False to work around some bug. For more context, see python#2290. It appears we no longer need this patch anymore. I'm not entirely sure why, but I'm guessing we tightened and fixed the underlying problem with deferred passes some time during the past half-decade.
Closespython#13561 Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
sobolevn
commented
Sep 3, 2022
Blocked by: #13579 |
sobolevn
commented
Sep 3, 2022
Going to open a new one, since this PR was affected by several other commits. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Two questions:
TypeErrormessage is good enough?.pyifiles from check? Or should it say consistent with.pyfiles?