fix: correct post_call TypeVar in annotate_logs overload + docstring typos#141
Open
AmSach wants to merge 1 commit into
Open
fix: correct post_call TypeVar in annotate_logs overload + docstring typos#141AmSach wants to merge 1 commit into
AmSach wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! Found a few small issues while browsing the source:
1. Inconsistent
post_callTypeVar in one overloadIn
annotated_logger/__init__.py, all 21 of the@overloaddefinitions ofannotate_logsdeclare:…and the implementation signature at the bottom also uses
PostCall[S2, P3]. But the "Instance False, Requested True, Provided True" overload (line ~647) accidentally usesP2: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
P3for consistency.2. Two docstring typos in
plugins.pyBasePlugin.uncaught_exception: "Handle an uncaught excaption." → "Handle an uncaught exception."RenamerPlugin.__init__andNameAdjusterPlugin.__init__: "pre/post fixs" → "pre/post fixes"All changes are local and don't alter runtime behavior. — Sent via @AmSach bot