strings: fix type hints and uncovered bugs - #2555
Conversation
There was a problem hiding this comment.
Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased) section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed
860a8e3 to
349d368
Compare
CHANGELOG updated or no update needed, thanks! 😄
e5b59d7 to
4678af7
Compare
changelog add strings tests strings: fix buf_filled_with fix strings tests refactor: optimize and document buf_filled_with function in strings.py docs: add docstring to buf_filled_with function doc strings: add typing
4678af7 to
ead038a
Compare
|
Also do this for FLOSS? |
mike-hunhoff
left a comment
There was a problem hiding this comment.
Looks good, thanks for the tests! LGTM 🚀
fariss
left a comment
There was a problem hiding this comment.
Good improvements, thanks. I have left some comments for your review.
|
these are all great ideas @fariss thank you! i'll add those in the morning and merge. thanks all |
| ASCII_RE_4 = re.compile(b"([%s]{%d,})" % (ASCII_BYTE, 4)) | ||
| UNICODE_RE_4 = re.compile(b"((?:[%s]\x00){%d,})" % (ASCII_BYTE, 4)) |
There was a problem hiding this comment.
imo 4 here is not very descriptive, I'd suggest declaring it a constant:
MIN_STRING_LENGTH = 4
ASCII_RE_4 = re.compile(b"([%s]{%d,})" % (ASCII_BYTE, MIN_STRING_LENGTH))
UNICODE_RE_4 = re.compile(b"((?:[%s]\x00){%d,})" % (ASCII_BYTE, MIN_STRING_LENGTH))|
got the whole crew on this thread! 👋 |
When adding type hints (at the suggestion of my editor), I found that some of the strings.py helpers probably didn't ever work on python3. So I fixed those up and added some tests.
TODO