-
Notifications
You must be signed in to change notification settings - Fork 191
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
Not a homogeneous array #324
Comments
Here's some context to put this in perspective. Version 0.5.0 of the TOML specification forbids arrays with mixed types, that is true. But, that requirement was dropped beginning with v1.0.0-rc.1. Conformant TOML parsers will no longer need to reject arrays for mixing types. That said, |
I don't think that it has to be raised. Quoting the toml-lang README:
|
Good catch. Then heterogeneous array support will be needed. |
Note that no exception is raised on write, only on read, resulting in data written by the library which cannot be read back. |
PR: #365 |
Is there a reason why this hasn't been closed yet? also, how can I install the v1.0.0rc referenced in one of the above comments? |
@zoj613, consider using tomli instead, as it implements the latest toml spec. Tomli also is the toml library that was incorporated into the python standard library (as |
tomli does not support the |
Since the data types that Assuming you have a custom Dict class def _into_CustomDict(origval):
if isinstance(origval, dict):
return CustomDict({k: _into_CustomDict(origval[k]) for k in origval})
elif isinstance(origval, list):
return [_into_CustomDict(tv) for tv in origval]
else:
return origval Then run |
array with multiple types not allows. for example
test = [ [10,5], 4]
or
test = ["aaa", 5]
The text was updated successfully, but these errors were encountered: