Skip to content

Type annotation bugfixes#4740

Merged
gpotter2 merged 3 commits into
secdev:masterfrom
marci07iq:master
May 29, 2025
Merged

Type annotation bugfixes#4740
gpotter2 merged 3 commits into
secdev:masterfrom
marci07iq:master

Conversation

@marci07iq
Copy link
Copy Markdown
Contributor

@marci07iq marci07iq commented May 9, 2025

This PR fixes two bugs in the type annotations:

  1. Fix types in the constructor of various Enum fields. Enum fields accept a variety of specific formats to describe the Enum name - value mapping. The type annotations now list all the accepted types. The list is taken from the base class _EnumField line 2521

  2. Fix the annotation of next_cls_cb in the PacketListField constructor. The comment on line 1700 shows the annotation correctly, but it was not correct in the actual function argument list.

No actual code was changes, only type annotations.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.15%. Comparing base (a4f958b) to head (eaa549e).
Report is 31 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4740      +/-   ##
==========================================
+ Coverage   82.13%   82.15%   +0.01%     
==========================================
  Files         361      361              
  Lines       86830    87284     +454     
==========================================
+ Hits        71319    71707     +388     
- Misses      15511    15577      +66     
Files with missing lines Coverage Δ
scapy/arch/linux/rtnetlink.py 91.81% <ø> (ø)
scapy/fields.py 92.88% <100.00%> (+0.01%) ⬆️

... and 42 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread scapy/fields.py Outdated
@gpotter2 gpotter2 merged commit 65843d0 into secdev:master May 29, 2025
24 checks passed
@gpotter2
Copy link
Copy Markdown
Member

Thanks for the PR !

@gpotter2 gpotter2 added this to the 2.7.0 milestone Nov 2, 2025
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.

2 participants