From c8b23bbbd25372a55d6e3640b68cd96828922af0 Mon Sep 17 00:00:00 2001 From: Numerlor Date: Tue, 21 Jun 2022 15:09:57 +0200 Subject: reword docstrings Co-authored-by: MarkKoz --- botcore/utils/function.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'botcore/utils/function.py') diff --git a/botcore/utils/function.py b/botcore/utils/function.py index 1cde5cd9..e8d24e90 100644 --- a/botcore/utils/function.py +++ b/botcore/utils/function.py @@ -28,17 +28,14 @@ def update_wrapper_globals( ignored_conflict_names: Set[str] = frozenset(), ) -> Callable[_P, _R]: r""" - Update globals of the ``wrapper`` function with the globals from the ``wrapped`` function. + Create a copy of ``wrapper``\, the copy's globals are updated with ``wrapped``\'s globals. For forwardrefs in command annotations, discord.py uses the ``__global__`` attribute of the function - to resolve their values, with decorators that replace the function this breaks because they have + to resolve their values. This breaks for decorators that replace the function because they have their own globals. - This function creates a new function functionally identical to ``wrapper``\, which has the globals replaced with - a merge of ``wrapped``\s globals and the ``wrapper``\s globals. - .. warning:: - This function captures the state of ``wrapped``\'s module's globals when it's called, + This function captures the state of ``wrapped``\'s module's globals when it's called; changes won't be reflected in the new function's globals. Args: -- cgit v1.2.3