Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table.copy should return an instance of table #65

Closed
Julian opened this issue Nov 30, 2019 · 0 comments · Fixed by #156
Closed

table.copy should return an instance of table #65

Julian opened this issue Nov 30, 2019 · 0 comments · Fixed by #156

Comments

@Julian
Copy link

Julian commented Nov 30, 2019

table.copy appears to return an instance of dict, not table:

⊙  rm -rf venv; python3.7 -m venv venv; venv/bin/python -m pip install --quiet tomlkit; venv/bin/python -m pip list | grep tomlkit; venv/bin/python -c '                julian@Air
import tomlkit
table = tomlkit.table()
print(type(table.copy()))'
/Users/julian/Desktop/venv/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py:133: DeprecationWarning: encoding is deprecated, Use raw=False instead.
  unpacker = Unpacker(None, max_buffer_size=len(packed), **kwargs)
tomlkit    0.5.8
<class 'dict'>

Besides having the type change during copying, this makes doing immutable changes to tables more difficult (copying a table and mutating the copy).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant