Skip to content

Fix with_signature docstring: it does support type hints#83

Open
hmgaudecker wants to merge 2 commits into
mainfrom
fix-docs
Open

Fix with_signature docstring: it does support type hints#83
hmgaudecker wants to merge 2 commits into
mainfrom
fix-docs

Conversation

@hmgaudecker
Copy link
Copy Markdown
Member

Summary

  • The with_signature docstring claimed "There is no way of setting default values or type hints." The type-hints half is false: the dict form of args/kwargs maps names to type strings, and return_annotation sets the return type. _create_signature writes both onto the inspect.Signature.
  • Reword the caveat and the args/kwargs/return_annotation parameter descriptions to reflect this. Default values genuinely remain unsupported (_create_signature never sets default=).
  • Wording is consistent with Make dags play nicely with runtime type checkers #82: the type hints live on the wrapper's __signature__; __annotations__ stays the *args, **kwargs forwarder shape.

Docstring-only change — no logic touched.

Test plan

  • ruff check / ruff format pass
  • Docstring renders correctly

The caveat claimed type hints could not be set. They can: the dict form
of args/kwargs maps names to type strings, and return_annotation sets
the return type. Reword the caveat and parameter descriptions to reflect
this; default values remain unsupported.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.56%. Comparing base (87ff051) to head (11082b1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #83   +/-   ##
=======================================
  Coverage   96.56%   96.56%           
=======================================
  Files          27       27           
  Lines        1398     1398           
=======================================
  Hits         1350     1350           
  Misses         48       48           

☔ 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.

The param holds an inspect-style annotation (it accepts the
inspect.Parameter.empty sentinel, which is not a type hint) and is
named return_annotation. "Type hint" stays in the caveat and the
args/kwargs dict-form descriptions, where the claim is genuinely about
expressing types.
Copy link
Copy Markdown
Member Author

@hmgaudecker hmgaudecker left a comment

Choose a reason for hiding this comment

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

Autoreview.

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