diff options
author | 2022-06-21 15:09:57 +0200 | |
---|---|---|
committer | 2022-06-21 17:59:14 +0200 | |
commit | c8b23bbbd25372a55d6e3640b68cd96828922af0 (patch) | |
tree | 9d4512c2e36c753765888233f352af3ec26c201e /botcore/utils/function.py | |
parent | Only append ids from Name nodes (diff) |
reword docstrings
Co-authored-by: MarkKoz <[email protected]>
Diffstat (limited to 'botcore/utils/function.py')
-rw-r--r-- | botcore/utils/function.py | 9 |
1 files changed, 3 insertions, 6 deletions
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: |