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

_normalize_string_argument should send the dict "values" not the "keys" to the _check_types function #29

Closed
ste-lau opened this issue Oct 25, 2021 · 1 comment

Comments

@ste-lau
Copy link

ste-lau commented Oct 25, 2021

Hi it's me again :)
Just caught a small bug and the fix is very simple (see below).

Symptom:

When trying to supply a dict for the node_shape argument (so that different nodes can have different shapes) it currently throws an exception:

 _main.py", line 1167, in _check_types
  raise TypeError(msg)
  TypeError: Item 0 in node_shape is of the wrong type.
     Expected type: <class 'str'>
     Actual type: <class 'int'>

Cause:

The first arg that currently is sent to the _check types function is str_or_dict which then gets iterated over as "for item in items". So it it's a dict, it's the keys which get iterated over rather than the values .

Fix:

The first arg that is sent to the **_check type**s function should be str_or_dict.values() instead of the current str_or_dict (as it correctly is in _normalize_numeric_argument)

@paulbrodersen
Copy link
Owner

You are becoming my favourite person on github! If you add an email to your github account, then I can attribute your fixes to your account such that you are listed as one of the contributors.

paulbrodersen added a commit that referenced this issue Oct 26, 2021
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