Skip to content

fix: silence Pyright false positive on transition calls#560

Merged
fgmacedo merged 1 commit intodevelopfrom
fix/511-pylance-transition-call-signature
Feb 13, 2026
Merged

fix: silence Pyright false positive on transition calls#560
fgmacedo merged 1 commit intodevelopfrom
fix/511-pylance-transition-call-signature

Conversation

@fgmacedo
Copy link
Owner

Summary

  • Changed AddCallbacksMixin.__call__(self, f) to __call__(self, *args, **kwargs) with runtime validation, silencing Pyright/Pylance false positive about missing parameter f when calling events
  • Pyright cannot follow the metaclass transformation from TransitionListEvent, so it reports sm.event() as missing the f argument
  • The decorator syntax (@transition_list) continues to work as before
  • Added test covering the TypeError for invalid call signatures on TransitionList

Closes #511

…ght (#511)

Pyright/Pylance cannot follow the metaclass transformation from
TransitionList to Event, so it sees sm.event() as calling
TransitionList.__call__(self, f) and reports a missing argument.

Change the signature to *args, **kwargs with runtime validation,
which preserves the decorator syntax while silencing the false positive.

Closes #511
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.77%. Comparing base (1f6013c) to head (5e5d145).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #560   +/-   ##
========================================
  Coverage    99.77%   99.77%           
========================================
  Files           25       25           
  Lines         1748     1751    +3     
  Branches       228      229    +1     
========================================
+ Hits          1744     1747    +3     
  Misses           2        2           
  Partials         2        2           
Flag Coverage Δ
unittests 99.77% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@fgmacedo fgmacedo merged commit 9697dea into develop Feb 13, 2026
15 checks passed
@fgmacedo fgmacedo deleted the fix/511-pylance-transition-call-signature branch February 13, 2026 19:32
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.

Argument missing for parameter "f" Pylance [reportCallIssue]

1 participant

Comments