python / python/mypy

Use union instead of join for unifying types

Open
#12,056 9 comments 28 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs discussion priority-0-high topic-join-v-union
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

@erictraut has gathered a long list of problems caused by mypy's behavior of using the "join" operator to unify types in various contexts.

  • #12053
  • #12009
  • #11934
  • #11440
  • #11618
  • #10740
  • #10442
  • #7884
  • #7835
  • #7616
  • #6968
  • #6079
  • #5512
  • #5128
  • #4134
  • #3339

I believe that we should change this behavior.

If someone opens a PR to do this, it would be interesting to see what the results look like in mypy-primer and mypy's CI.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked issues (#12053, #12009, #11934, #11440, #11618, #10740, #10442, #7884, #7835, #7616, #6968, #6079, #5512, #5128, #4134, and #3339) to map the affected contexts. Then compare results in mypy-primer and mypy's CI; done means the unification behavior has been changed and its effects are understood across those checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.