dict.__init__() and dict.update() don't match
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 2.1k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 82
Description
In stubs, __init__ has 5 overloads and update() has 3 overloads. But at runtime, dict.update() accepts everything that dict.__init__ accepts. For example:
>>> d={}
>>> d.update((s.split('=') for s in ['a=b', 'c=d']), lol='wut')
>>> d
{'a': 'b', 'c': 'd', 'lol': 'wut'}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open stdlib/builtins.pyi and inspect the linked overload ranges for dict.init() and dict.update(). Reproduce the documented runtime example, then compare the accepted call shapes; done means the update() stub matches the initialization forms described by the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100