diff options
| author | django-bot <ops@djangoproject.com> | 2025-07-22 20:41:41 -0700 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2025-07-23 20:17:55 -0300 |
| commit | 69a93a88edb56ba47f624dac7a21aacc47ea474f (patch) | |
| tree | f57507a4435d032493cae40e06ecb254790b67b2 /django/dispatch | |
| parent | 55b0cc21310b76ce4018dd793ba50556eaf0af06 (diff) | |
Refs #36500 -- Rewrapped long docstrings and block comments via a script.
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
Diffstat (limited to 'django/dispatch')
| -rw-r--r-- | django/dispatch/__init__.py | 5 | ||||
| -rw-r--r-- | django/dispatch/dispatcher.py | 34 |
2 files changed, 21 insertions, 18 deletions
diff --git a/django/dispatch/__init__.py b/django/dispatch/__init__.py index a615f9905a..bd219b4809 100644 --- a/django/dispatch/__init__.py +++ b/django/dispatch/__init__.py @@ -1,7 +1,8 @@ """Multi-consumer multi-producer dispatching mechanism -Originally based on pydispatch (BSD) https://pypi.org/project/PyDispatcher/2.0.1/ -See license.txt for original license. +Originally based on pydispatch (BSD) +https://pypi.org/project/PyDispatcher/2.0.1/ See license.txt for original +license. Heavily modified for Django's purposes. """ diff --git a/django/dispatch/dispatcher.py b/django/dispatch/dispatcher.py index 4b962ce524..eed321c690 100644 --- a/django/dispatch/dispatcher.py +++ b/django/dispatch/dispatcher.py @@ -29,7 +29,8 @@ class Signal: Internal attributes: receivers: - [((id(receiver), id(sender)), ref(receiver), ref(sender), is_async)] + [((id(receiver), id(sender)), ref(receiver), ref(sender), + is_async)] sender_receivers_cache: WeakKeyDictionary[sender, list[receiver]] """ @@ -75,12 +76,12 @@ class Signal: weak Whether to use weak references to the receiver. By default, the module will attempt to use weak references to the receiver - objects. If this parameter is false, then strong references will - be used. + objects. If this parameter is false, then strong references + will be used. dispatch_uid - An identifier used to uniquely identify a particular instance of - a receiver. This will usually be a string, though it may be + An identifier used to uniquely identify a particular instance + of a receiver. This will usually be a string, though it may be anything hashable. """ from django.conf import settings @@ -133,8 +134,8 @@ class Signal: """ Disconnect receiver from sender for signal. - If weak references are used, disconnect need not be called. The receiver - will be removed from dispatch automatically. + If weak references are used, disconnect need not be called. The + receiver will be removed from dispatch automatically. Arguments: @@ -173,9 +174,9 @@ class Signal: """ Send signal from sender to all connected receivers. - If any receiver raises an error, the error propagates back through send, - terminating the dispatch loop. So it's possible that all receivers - won't be called if an error is raised. + If any receiver raises an error, the error propagates back through + send, terminating the dispatch loop. So it's possible that all + receivers won't be called if an error is raised. If any receivers are asynchronous, they are called after all the synchronous receivers via a single call to async_to_sync(). They are @@ -292,8 +293,8 @@ class Signal: Arguments: sender - The sender of the signal. Can be any Python object (normally one - registered with a connect if you actually want something to + The sender of the signal. Can be any Python object (normally + one registered with a connect if you actually want something to occur). named @@ -357,8 +358,8 @@ class Signal: Arguments: sender - The sender of the signal. Can be any Python object (normally one - registered with a connect if you actually want something to + The sender of the signal. Can be any Python object (normally + one registered with a connect if you actually want something to occur). named @@ -439,8 +440,9 @@ class Signal: receivers = None if self.use_caching and not self._dead_receivers: receivers = self.sender_receivers_cache.get(sender) - # We could end up here with NO_RECEIVERS even if we do check this case in - # .send() prior to calling _live_receivers() due to concurrent .send() call. + # We could end up here with NO_RECEIVERS even if we do check this + # case in .send() prior to calling _live_receivers() due to + # concurrent .send() call. if receivers is NO_RECEIVERS: return [], [] if receivers is None: |
