Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

'dict_keys' object does not support indexing #31

Open
crudo10 opened this issue Nov 20, 2016 · 0 comments
Open

'dict_keys' object does not support indexing #31

crudo10 opened this issue Nov 20, 2016 · 0 comments

Comments

@crudo10
Copy link
Contributor

crudo10 commented Nov 20, 2016

Function _example_from_array_spec in swagger_parser.py contains the following line:
return example_dict[example_dict.keys()[0]]
which throws

TypeError: 'dict_keys' object does not support indexing

error in Python 3 since example_dict.keys() returns a view object not a list.
It should be something like example_dict[list(example_dict)[0]] in order to work for Python 3.

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

No branches or pull requests

1 participant