chore: modernize type hints to PEP 604 union syntax#38
chore: modernize type hints to PEP 604 union syntax#38masterking32 merged 6 commits intomasterking32:mainfrom
Conversation
Replace Optional[X], Dict[K,V], and Tuple[X,Y] from the typing module with the built-in PEP 604 / PEP 585 equivalents (X | None, dict[K,V], tuple[X,Y]) across client.py, server.py, DnsPacketParser.py, and utils.py. Also adds pylint disable comments for the intentional import-outside-toplevel patterns on platform-specific inline imports. Made-with: Cursor
Added a requirement for Python version 3.10 or higher in the setup configuration to ensure compatibility with the codebase.
Preserve both name='dns_utils_cython_build' from main and python_requires='>=3.10' from the PR branch. Made-with: Cursor
Resolve three merge conflicts from upstream divergence: - build_setup.py: adopt upstream name 'masterdnsvpn_cython_build' while retaining python_requires='>=3.10' constraint. - client.py: keep PEP 604 typed signature for _process_received_packet; modernize two Optional usages added by upstream to X | None syntax. - server.py: drop unused typing imports; modernize all Optional[X] annotations added by upstream to X | None syntax; include upstream's new _pre_session_packet_types early-exit block in handle_vpn_packet. Made-with: Cursor
Made-with: Cursor
This reverts commit 97c4756.
|
@masterking32 I think #40 was needed first because of the pyproject.toml. |
|
These changes are not acceptable because they do not support older Python versions! |
Python 3.9 is now fully end of life and stopped receiving security updates on 31 Oct 2025, these changes are supported by Python 3.10+. |
|
Yeah, that's true, but Ubuntu 20.04 comes with Python 3.8 and some other versions of Linux. |
What should the minimum supported version be? 3.8? It could be an option to advise users of outdated python versions to use https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa to update to a newer version while still staying on the same os version. There are several high security vulnerabilities in 3.8-3.9. |
|
Never mind, I need to switch to Go-Lang, Python is not good for this project xD |
Claude can rewrite it, I would do it but im using too many tokens. |
That's cool, but I've already started that, |
Summary
Files changed
Notes
dns_utils/ARQ.py type hint modernization is included in the companion PR ix/arq-io-loop alongside the ARQ IO loop bug fixes to keep that diff self-contained.