Skip to content

Add set_complete for type-checked completion assignment - #259

Open
KapJI wants to merge 1 commit into
tqdm:mainfrom
KapJI:set-complete
Open

KapJI wants to merge 1 commit into
tqdm:mainfrom
KapJI:set-complete

Conversation

@KapJI

@KapJI KapJI commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

complete is not declared on argparse.Action, so add_argument(...).complete = shtab.FILE fails type checking with "Action" has no attribute "complete". Both examples/pathcomplete.py and examples/customcomplete.py suppress this with # mypy: disable-error-code="attr-defined".

set_complete(action, complete) makes the same assignment behind a typed signature. The attribute style is unchanged, so the examples keep it. I can convert them and remove the suppressions if you prefer.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.87%. Comparing base (e1ab406) to head (0e16eee).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
+ Coverage   87.83%   87.87%   +0.03%     
==========================================
  Files           4        4              
  Lines         666      668       +2     
  Branches      138      138              
==========================================
+ Hits          585      587       +2     
  Misses         43       43              
  Partials       38       38              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch was successfully deployed

1 active deployment
pypi — 0e16eee9 Deployed Sep 2, 2026 by KapJI via deploy #1353
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