Skip to content

fix: correct post_call TypeVar in annotate_logs overload + docstring typos#141

Open
AmSach wants to merge 1 commit into
github:mainfrom
AmSach:fix/incorrect-post-call-typevar
Open

fix: correct post_call TypeVar in annotate_logs overload + docstring typos#141
AmSach wants to merge 1 commit into
github:mainfrom
AmSach:fix/incorrect-post-call-typevar

Conversation

@AmSach

@AmSach AmSach commented Jun 18, 2026

Copy link
Copy Markdown

Hi! Found a few small issues while browsing the source:

1. Inconsistent post_call TypeVar in one overload

In annotated_logger/__init__.py, all 21 of the @overload definitions of annotate_logs declare:

post_call: PostCall[S2, P3] = None,

…and the implementation signature at the bottom also uses PostCall[S2, P3]. But the "Instance False, Requested True, Provided True" overload (line ~647) accidentally uses P2:

post_call: PostCall[S2, P2] = None,  # <-- inconsistent

This makes the overload's type signature disagree with the actual function (and with every sibling overload), which breaks type inference for users decorating a bare function that both requests a logger and accepts one passed in. Fix is to make it P3 for consistency.

2. Two docstring typos in plugins.py

  • BasePlugin.uncaught_exception: "Handle an uncaught excaption." → "Handle an uncaught exception."
  • RenamerPlugin.__init__ and NameAdjusterPlugin.__init__: "pre/post fixs" → "pre/post fixes"

All changes are local and don't alter runtime behavior. — Sent via @AmSach bot

…typos

- In the 'Instance False, Requested True, Provided True' overload of
  annotate_logs, post_call used PostCall[S2, P2] while all 21 other
  overloads and the implementation signature use PostCall[S2, P3]. This
  was inconsistent with the rest of the type signature and broke type
  hinting for that specific overload.
- Fix two docstring typos in plugins.py: 'excaption' -> 'exception' and
  'fixs' -> 'fixes' in BasePlugin.uncaught_exception and
  RenamerPlugin/NameAdjusterPlugin __init__ docstrings.
@AmSach AmSach requested a review from a team as a code owner June 18, 2026 00:04
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