Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add type information to LoggingContext.__call__
Adds a `DecoratedCallable` TypeVar and uses that in the type hints for the `__call__` method in `LoggingContext`. This allows type information to pass through correctly when used as a decorator. It seems like the `@wraps` decorator on the wrapper mangles the type info so I had to disable type checking on the return because Pyright was convinced it was wasn't the correct type, but the tests proved otherwise. I'm not sure there's a good way to test since at runtime the function signature is getting passed through correctly. It's only on the type checking pass that things break down. It's probably fine as-is since no tests broke as a result, but figured it was worth mentioning. Fixes #60
- Loading branch information