Skip to content
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

[HINTY] Modernise typing in scapy/ansmachine.py #4650

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarcoGorelli
Copy link

@MarcoGorelli MarcoGorelli commented Feb 1, 2025

Checklist:

  • If you are new to Scapy: I have checked CONTRIBUTING.md (esp. section submitting-pull-requests)
  • I squashed commits belonging together
  • I added unit tests or explained why they are not relevant
  • I executed the regression tests (using cd test && ./run_tests or tox)
  • If the PR is still not finished, please create a Draft Pull Request

fixes #4649

Copy link

codecov bot commented Feb 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.72%. Comparing base (f998c63) to head (2e5283e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4650      +/-   ##
==========================================
- Coverage   81.42%   78.72%   -2.70%     
==========================================
  Files         359      334      -25     
  Lines       86237    81039    -5198     
==========================================
- Hits        70215    63796    -6419     
- Misses      16022    17243    +1221     
Files with missing lines Coverage Δ
scapy/ansmachine.py 66.84% <100.00%> (-1.09%) ⬇️

... and 286 files with indirect coverage changes

@@ -11,6 +11,8 @@
# Answering machines #
########################

from __future__ import annotations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer support Python 2, so this is not wanted.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review!

This is still necessary if you want to use modern type hints such as dict[str] instead of Dict[str] https://peps.python.org/pep-0585/

I can revert to Dict if you prefer, it just requires an extra from typing import Dict

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.

Modernising type annotations, and Python2 is support
2 participants