Skip to content

Commit

Permalink
fix: Typing hint for builder
Browse files Browse the repository at this point in the history
Maintain that the Callable type received is the same as the Callable returned
  • Loading branch information
gavindsouza committed Aug 10, 2023
1 parent 30574f9 commit caaa531
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pypika/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable, List, Optional, Type
from typing import Any, Callable, List, Optional, Type, TypeVar

__author__ = "Timothy Heys"
__email__ = "[email protected]"
Expand Down Expand Up @@ -36,7 +36,9 @@ class FunctionException(Exception):
pass


def builder(func: Callable) -> Callable:
C = TypeVar("C")

def builder(func: C) -> C:
"""
Decorator for wrapper "builder" functions. These are functions on the Query class or other classes used for
building queries which mutate the query and return self. To make the build functions immutable, this decorator is
Expand Down

0 comments on commit caaa531

Please sign in to comment.