Skip to content

Assignment to invalid type #44

Description

@balderman1

I try to convert all values of a FlatterDict to strings.
The email field caused an exception.

See below

data = {
    "x": "12",
    "other": "MLL",
    "channel": 33,
    "language": "EN",
    "email": [
        "jack@ecme.com"
    ]
}

flat = flatdict.FlatterDict(data)

for k in flat.keys():
    flat[k] = str(flat[k])

Error:

  File "C:\dev\tools\python371\lib\site-packages\flatdict.py", line 416, in __setitem__
    pk, self._delimiter, ck))
TypeError: Assignment to invalid type for key email:0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions