-
Notifications
You must be signed in to change notification settings - Fork 95
Adding iterator method to Dict #59
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #59 +/- ##
==========================================
+ Coverage 67.94% 68.38% +0.44%
==========================================
Files 59 59
Lines 10378 10435 +57
==========================================
+ Hits 7051 7136 +85
+ Misses 2828 2794 -34
- Partials 499 505 +6
Continue to review full report at Codecov.
|
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 tackling this.
could you also add a test exercizing this new feature?
thanks!
According to the coverage report your test doesn't hit your added code? |
The code is covered in |
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.
That is looking good! Can you just sharpen the test slightly and I'll merge - thanks :-)
py/tests/dict.py
Outdated
@@ -12,4 +12,8 @@ | |||
a = repr({"a":"b","c":5.5}) | |||
assert a == "{'a': 'b', 'c': 5.5}" or a == "{'c': 5.5, 'a': 'b'}" | |||
|
|||
doc="check __iter__" | |||
a = {"a":"b","c":5.5} | |||
assert "a" in a |
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.
Strictly speaking this test will no longer work when we implement the __contains__
method for dict.
Do can you change it to something like
l = list(iter(a))
assert "a" in l
assert "c" in l
assert len(l) == 2
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.
This should be fixed now
That looks great now thank you! I see you added an items method too :-) Will merge now. |
Addresses #58