-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add id and comment #110
Add id and comment #110
Conversation
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.
Yes, very nice! This will be really nice to have. We should make a release as soon as this is merged.
This also needs a changelog and documentation update. (I can do that if you don’t have time over the coming days.)
self._comment = "" | ||
else: | ||
comment_length = name_length - (id_length + 1) | ||
comment_start = name + id_length + 1 |
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.
Hm, this assumes that there’s only one whitespace between the id and the comment. I’d assume this is true most of the time, but I think we need to be a bit more defensive.
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.
Finally, a use for strspn!
src/dnaio/_core.pyx
Outdated
comment_start = name + id_length + 1 | ||
self._comment = PyUnicode_New(comment_length , 127) | ||
memcpy(PyUnicode_DATA(self._comment), comment_start, comment_length) | ||
# Cached but nothing is internally empty string, expose externally as None |
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 don’t get the comment. Maybe just remove? Would be ok
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 will try to make it more clear in the comment. It is a rather odd design choice so it needs one, I think.
(SequenceRecord("name ", "A", "="), None), | ||
(SequenceRecord("name ", "A", "="), " "), | ||
(SequenceRecord("name", "A", "="), None), | ||
(SequenceRecord("AotC I hate sand!", "A", "="), "I hate sand!"), |
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.
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, I got the Star Wars reference, but didn’t know the song (and now it’ll be stuck in my head for the rest of the day ...)
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.
Well you could always listen to "Last jedi knight" by the same musician to get it out of your head again ;-).
All done! |
I’m happy with this now! Let’s also make a release soon. |
You had something like this in mind?
EDIT:
fixes #10