@@ -34,7 +34,7 @@ def extra(method: ExtraMethod) -> "ExtraMethod":
3434 dispatch_method : ty .Callable [..., ty .Any ] = functools .singledispatch (method )
3535
3636 @functools .wraps (method )
37- def decorated (obj : DataType , * args : ty .Any , ** kwargs : ty .Any ) -> ty .Any :
37+ def decorated_extra (obj : DataType , * args : ty .Any , ** kwargs : ty .Any ) -> ty .Any :
3838 cls = type (obj )
3939 extras = []
4040 for tp in cls .referenced_types (): # type: ignore[attr-defined]
@@ -61,8 +61,8 @@ def decorated(obj: DataType, *args: ty.Any, **kwargs: ty.Any) -> ty.Any:
6161
6262 # Store single dispatch method on the decorated function so we can register
6363 # implementations to it later
64- decorated ._dispatch = dispatch_method # type: ignore[attr-defined]
65- return decorated # type: ignore[return-value]
64+ decorated_extra ._dispatch = dispatch_method # type: ignore[attr-defined]
65+ return decorated_extra # type: ignore[return-value]
6666
6767
6868def extra_implementation (
@@ -78,7 +78,9 @@ def extra_implementation(
7878 "an implementation"
7979 )
8080
81- def decorator (implementation : ExtraImplementation ) -> ExtraImplementation :
81+ def extra_implementation_decorator (
82+ implementation : ExtraImplementation ,
83+ ) -> ExtraImplementation :
8284 msig = inspect .signature (method )
8385 fsig = inspect .signature (implementation )
8486 msig_args = list (msig .parameters .values ())[1 :]
@@ -188,7 +190,7 @@ def type_match(mtype: ty.Union[str, type], ftype: ty.Union[str, type]) -> bool:
188190 dispatch_method .register (implementation )
189191 return implementation
190192
191- return decorator
193+ return extra_implementation_decorator
192194
193195
194196WrappedTask = ty .TypeVar ("WrappedTask" , bound = ty .Callable [..., ty .Any ])
0 commit comments