Skip to content

Conversation

@hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Jan 23, 2026

Relates to this comment from A5rocks: #20492 (comment)

Fixes #20532
Fixes #18029
Fixes #17229
Fixes #16465
Closes #18574

Co-authored-by: A5rocks
else_map = {}
partial_type_maps.append((if_map, else_map))

for i in custom_eq_indices:
Copy link
Collaborator Author

@hauntsaninja hauntsaninja Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a later PR that condenses this a little bit / adds more comments

Maybe worth looking at the version on my dev branch: https://github.com/hauntsaninja/mypy/pull/5/files#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04R6699

@github-actions

This comment has been minimized.

@hauntsaninja
Copy link
Collaborator Author

hauntsaninja commented Jan 23, 2026

graphql one will be fixed by improving logic around this:

mypy/mypy/checker.py

Lines 8544 to 8546 in 21d6773

"builtins.list",
"builtins.dict",
"builtins.set",

I have a commit for this later in my stack

Still minimising the dd-trace-py one

@hauntsaninja
Copy link
Collaborator Author

hauntsaninja commented Jan 23, 2026

Okay dd-trace-py is a "true positive". It gets a little confusing in that o is Any so o.__name__ is Any. But basically boils down to if (x: str | Any) == (str | int): reveal_type(x) # str | int | Any which is very defensible (I added a test for it)

@github-actions

This comment has been minimized.

@hauntsaninja hauntsaninja requested a review from A5rocks January 23, 2026 23:56
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

graphql-core (https://github.com/graphql-python/graphql-core)
+ tests/execution/test_resolve.py:322: error: Value of type "list[SourceLocation] | None" is not indexable  [index]

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/debugging/_function/discovery.py:219: error: Argument 2 to "undecorated" has incompatible type "str | Any | int | type[staticmethod[Any, Any]] | type[classmethod[Any, Any, Any]]"; expected "str"  [arg-type]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant