Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

function with argument of type`Item` should be compatible with `Table`

Open
#135 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start in items.py around the linked Item definition and inspect the Container.add entry point and its type annotations. Reproduce the reported mypy error with Python 3.7.2 and mypy 0.790; done means mypy accepts passing a Table to add without the incompatible-type error.

Written by the indexing model from the issue text.

Description

Error:

Argument 2 to "add" of "Container" has incompatible type "Table"; expected "Optional[Item]"

However, in the source code of Item, it indicates it can be a Table.

https://github.com/sdispater/tomlkit/blob/627fb1ae496a2531ec738e00c1abf6339472c1a4/tomlkit/items.py#L303-L304

It should allow me to pass a Table to .add().

Version 0.7.2
Python 3.7.2
mypy: 0.790

Dominant language
Python
Stars
850
Forks
163
Avg merge
13m
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

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.

More from python-poetry/tomlkit

All issues in python-poetry/tomlkit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.