| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Positive effect in Rapptz/discord.py: |
Sorry, something went wrong.
|
@hauntsaninja since you approved #13838, can take a look? |
Sorry, something went wrong.
| d_final: DFinal | ||
|
|
||
| if 'spam' in d_final: | ||
| spam = 'ham' # E: Statement is unreachable |
There was a problem hiding this comment.
Is this test really useless? E.g. this seems useful and I'm not sure where else it is tested
Sorry, something went wrong.
There was a problem hiding this comment.
Good point, brought it back in a68b87a (and also removed more @finals).
Sorry, something went wrong.
|
@hauntsaninja another review? |
Sorry, something went wrong.
|
Diff from mypy_primer, showing the effect of this PR on open source code: discord.py (https://github.com/Rapptz/discord.py)
- discord/audit_logs.py:251: error: Argument "allow_list" to "AutoModTrigger" has incompatible type "object"; expected "list[str] | None" [arg-type]
- discord/audit_logs.py:257: error: Argument "allow_list" to "AutoModTrigger" has incompatible type "object"; expected "list[str] | None" [arg-type]
- discord/audit_logs.py:258: error: Argument "regex_patterns" to "AutoModTrigger" has incompatible type "object"; expected "list[str] | None" [arg-type]
|
Sorry, something went wrong.
|
This issue recently came up on another forum, and it seems the fix is stuck in limbo. The diff seems fairly innocuous, the build/tests pass, and the discussion elsewhere seemed to conclude that this is the correct fix. Further, pyright merged the equivalent fix. Is it possible for this to be revisited? |
Sorry, something went wrong.
|
@hauntsaninja Can we revisit this? |
Sorry, something went wrong.
|
I think it would be good to try and get whatever behaviour is desired here into the typing spec. Would you or gandhis1 be willing to follow the steps here? https://github.com/python/typing-council#decisions |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
We shouldn't require T1 and T2 to be final, to have 'foo' in Union[TD1, TD2] narrowing take place. We previously (#13838) thought we should, but @erictraut made a good point that TypedDicts are structured types (like interfaces in TypeScript) and we shouldn't consider class hierarchy when type-matching but rather just the structure.
Fixes #15697.