-
Notifications
You must be signed in to change notification settings - Fork 0
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
Iter #46
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #46 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 176 178 +2
Branches 25 25
=========================================
+ Hits 176 178 +2 ☔ View full report in Codecov by Sentry. |
opr/primer.py
Outdated
def __iter__(self): | ||
""" | ||
Iterate through Primer. | ||
|
||
:return: None | ||
""" | ||
for base in self.sequence: | ||
yield base | ||
|
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.
you can go with this:
def __iter__(self):
"""
Iterate through Primer.
:return: Iterator[str]
"""
yield from self.sequence
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.
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.
Good point ,fixed in be19663.
However, using return: None
is more precise.
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.
when I run type(primer_instance.iter()) it is printed as: <class 'generator'>
and in this case it is Generator[str]
.
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 your effort, the only comment that I have is the return type of the __iter__
function which is generator.
Fixed in 03f8e37 |
Reference Issues/PRs
What does this implement/fix? Explain your changes.
__iter__
overload addedAny other comments?