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

Update concurrent_scanner.py #251

Merged
merged 1 commit into from
Nov 6, 2017
Merged

Update concurrent_scanner.py #251

merged 1 commit into from
Nov 6, 2017

Conversation

gopar
Copy link
Contributor

@gopar gopar commented Oct 27, 2017

In Py3.x doing dict.values() returns a dict_values instance which does not allow index lookup. Have to convert it to a list

>>> a = {'a':1, 'b':2}
>>> a.values()
dict_values([1, 2])
>>> list(a.values())[0]
1
>>> a.values()[0]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    a.values()[0]
TypeError: 'dict_values' object does not support indexing
>>> 

In Py3.x doing `dict.values()` returns a `dict_values` instance which does not allow index lookup. Have to convert it to a `list`

```python
>>> a = {'a':1, 'b':2}
>>> a.values()
dict_values([1, 2])
>>> a.values()[0]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    a.values()[0]
TypeError: 'dict_values' object does not support indexing
>>> list(a.values())[0]
1
>>> 
```
@nabla-c0d3 nabla-c0d3 merged commit b3b688c into nabla-c0d3:master Nov 6, 2017
@nabla-c0d3
Copy link
Owner

Thanks! Was it causing a crash or?

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 this pull request may close these issues.

2 participants