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

Possibly misbehaviour of match_value function? #6

Closed
MikhailMS opened this issue Nov 27, 2018 · 3 comments
Closed

Possibly misbehaviour of match_value function? #6

MikhailMS opened this issue Nov 27, 2018 · 3 comments

Comments

@MikhailMS
Copy link

Hello there

Thank for the great package. Gets really handy in my current projects :)

However, I'm wondering if following piece of code was intentionally written or it is just an logical error(?)

#pampy.py
....
ValueType = (int, float, str, bool)
....
elif isinstance(pattern, ValueType):
return pattern is value, []
....

It is a bad idea to compare strings with is operator, isn't it?
In one of the projects I'm getting errors because strings cannot be properly compared. I use regex as a workaround, but it seems like an overkill for my case, where I compare simple strings, nothing fancy

@santinic
Copy link
Owner

santinic commented Nov 28, 2018

Aw, thanks, you are right. I fixed it in v 0.1.9. Now I compare with a == b and checking type(a) == #type(b).

Fixed in this commit 63a98d8

@santinic
Copy link
Owner

santinic commented Nov 28, 2018

@MikhailMS Could you confirm 0.1.9 fixes your issues ? Thanks again

@MikhailMS
Copy link
Author

@santinic awesome 👍 confirm that it fixes my problem

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