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

populate_rango.py cat_data["pages"] #52

Open
jujes opened this issue Mar 2, 2017 · 1 comment
Open

populate_rango.py cat_data["pages"] #52

jujes opened this issue Mar 2, 2017 · 1 comment

Comments

@jujes
Copy link

jujes commented Mar 2, 2017

Hi, how fix it?

Expected 'collections.Iterable', got 'Union[List[Dict[str, Union[str, int]]], int]' instead less...

This inspection detects type errors in function call expressions. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Types of function parameters can be specified in docstrings or in Python 3 function annotations.

    for cat, cat_data in cats.items():
        # c = add_cat(cat)
        c = add_cat(cat, cat_data["views"], cat_data["likes"])
        for p in cat_data["pages"]:
            add_page(c, p["title"], p["url"], p["views"])
@imanvanassum
Copy link

Hi jujes,

That bit of code looks fine, I think the problem lies in your cats dictionary.
If you haven't solved this one yet, could you paste that bit of code here?

I suspect you enclosed the cat items with square brackets instead of curly ones.

Regards,
Iman

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

No branches or pull requests

2 participants