Skip to content

Commit

Permalink
OPT: add the comments + override flag 💡
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Nov 17, 2023
1 parent d52afe6 commit 94f86c2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions combadge/core/binder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from inspect import signature as get_signature
from typing import TYPE_CHECKING, Any, Callable, Iterable

from typing_extensions import override

from combadge.core.markers.method import MethodMarker
from combadge.core.service import BaseBoundService
from combadge.core.typevars import BackendT, FunctionT, ServiceProtocolT
Expand Down Expand Up @@ -49,9 +51,10 @@ class BoundService(BaseBoundService, from_protocol): # type: ignore[misc, valid

for name, method in _enumerate_methods(from_protocol):
signature = Signature.from_method(method)
bound_method: ServiceMethod = bind_method(signature)
bound_method: ServiceMethod = bind_method(signature) # generate implementation by the backend
update_wrapper(bound_method, method)
bound_method = _wrap(bound_method, signature.method_markers)
bound_method = _wrap(bound_method, signature.method_markers) # apply user decorators
bound_method = override(bound_method) # no functional change, just possibly setting `__override__`
setattr(BoundService, name, bound_method)

del BoundService.__abstractmethods__
Expand Down

0 comments on commit 94f86c2

Please sign in to comment.