Skip to content

Modernize for 2025 (Python 3.9+ only)#8

Open
dlenski wants to merge 13 commits into
jlitzingerdev:masterfrom
dlenski:modernize
Open

Modernize for 2025 (Python 3.9+ only)#8
dlenski wants to merge 13 commits into
jlitzingerdev:masterfrom
dlenski:modernize

Conversation

@dlenski
Copy link
Copy Markdown

@dlenski dlenski commented Jan 17, 2025

No need for six, attrs (replace with dataclasses), external typing, binascii.unhexlify, etc.

I also renamed the parse(msg: bytes, output: list) -> int method to parse_into, and created a more convenient parse(msg: bytes) -> tuple(int, list) method that returns a newly-created list of parsed messages.

Testing

tox passing for Python 3.9, 3.10, 3.11, 3.12, and mypy

@dlenski dlenski changed the title Modernize to support Python 3.9+ Modernize for 2025 (Python 3.9+ only) Jan 17, 2025
And also un-confuse mypy type checker for `Optional[int]` case
…d packet

A simple test case for this revealed that `parse_into()` was broken and
couldn't actually parse a buffer containing multiple concatenated packets,
even though that seems to have been the entire reason for its
progressive-parsing structure.  🤔

So I fixed that.
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

Successfully merging this pull request may close these issues.

1 participant