-
Notifications
You must be signed in to change notification settings - Fork 12
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
Change tuples of kwargs
to lists
#124
Conversation
Since these are all read only, this shouldn't make a difference |
parastell/source_mesh.py
Outdated
@@ -95,7 +95,7 @@ def __init__( | |||
|
|||
self.scale = m2cm | |||
|
|||
for name in kwargs.keys() & ('scale'): | |||
for name in kwargs.keys() & ['scale']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes single strings are treated as lists... not sure if that's the problem, but if it is, I don't think this will fix it.
One fix is to add a dangling comma after the string, inside the list/tuple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that changing the tuple to a list fixes the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a trailing comma also works though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I like the tuple better because of the way it communicates immutability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I've reverted to tuples but used a trailing comma for SourceMesh
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding/fixing this @connoramoreno - looks like we need more testing :)
Change tuples of `kwargs` to lists
Changes the tuple of strings against which keyword arguments are checked to a list format.
Fixes #123.