Loading django/dispatch/dispatcher.py +6 −4 Original line number Diff line number Diff line import sys import threading import warnings import weakref from django.utils.deprecation import RemovedInDjango21Warning from django.utils.six.moves import range if sys.version_info < (3, 4): Loading Loading @@ -133,7 +135,7 @@ class Signal(object): self.receivers.append((lookup_key, receiver)) self.sender_receivers_cache.clear() def disconnect(self, receiver=None, sender=None, weak=True, dispatch_uid=None): def disconnect(self, receiver=None, sender=None, weak=None, dispatch_uid=None): """ Disconnect receiver from sender for signal. Loading @@ -149,12 +151,12 @@ class Signal(object): sender The registered sender to disconnect weak The weakref state to disconnect dispatch_uid the unique identifier of the receiver to disconnect """ if weak is not None: warnings.warn("Passing `weak` to disconnect has no effect.", RemovedInDjango21Warning, stacklevel=2) if dispatch_uid: lookup_key = (dispatch_uid, _make_id(sender)) else: Loading docs/internals/deprecation.txt +2 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,8 @@ about each item can often be found in the release notes of two versions prior. See the :ref:`Django 1.9 release notes<deprecated-features-1.9>` for more details on these changes. * ... * The ``weak`` argument to ``django.dispatch.signals.Signal.disconnect()`` will be removed. .. _deprecation-removed-in-2.0: Loading docs/releases/1.9.txt +5 −1 Original line number Diff line number Diff line Loading @@ -177,7 +177,11 @@ Miscellaneous Features deprecated in 1.9 ========================== ... Miscellaneous ~~~~~~~~~~~~~ * The ``weak`` argument to ``django.dispatch.signals.Signal.disconnect()`` has been deprecated as it has no effect. .. removed-features-1.9: Loading docs/topics/signals.txt +6 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ error instance is returned in the tuple pair for the receiver that raised the er Disconnecting signals ===================== .. method:: Signal.disconnect([receiver=None, sender=None, weak=True, dispatch_uid=None]) .. method:: Signal.disconnect([receiver=None, sender=None, dispatch_uid=None]) To disconnect a receiver from a signal, call :meth:`Signal.disconnect`. The arguments are as described in :meth:`.Signal.connect`. The method returns Loading @@ -287,3 +287,8 @@ may be ``None`` if ``dispatch_uid`` is used to identify the receiver. .. versionchanged:: 1.8 The boolean return value was added. .. deprecated:: 1.9 The ``weak`` argument is deprecated as it has no effect. It will be removed in Django 2.1. Loading
django/dispatch/dispatcher.py +6 −4 Original line number Diff line number Diff line import sys import threading import warnings import weakref from django.utils.deprecation import RemovedInDjango21Warning from django.utils.six.moves import range if sys.version_info < (3, 4): Loading Loading @@ -133,7 +135,7 @@ class Signal(object): self.receivers.append((lookup_key, receiver)) self.sender_receivers_cache.clear() def disconnect(self, receiver=None, sender=None, weak=True, dispatch_uid=None): def disconnect(self, receiver=None, sender=None, weak=None, dispatch_uid=None): """ Disconnect receiver from sender for signal. Loading @@ -149,12 +151,12 @@ class Signal(object): sender The registered sender to disconnect weak The weakref state to disconnect dispatch_uid the unique identifier of the receiver to disconnect """ if weak is not None: warnings.warn("Passing `weak` to disconnect has no effect.", RemovedInDjango21Warning, stacklevel=2) if dispatch_uid: lookup_key = (dispatch_uid, _make_id(sender)) else: Loading
docs/internals/deprecation.txt +2 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,8 @@ about each item can often be found in the release notes of two versions prior. See the :ref:`Django 1.9 release notes<deprecated-features-1.9>` for more details on these changes. * ... * The ``weak`` argument to ``django.dispatch.signals.Signal.disconnect()`` will be removed. .. _deprecation-removed-in-2.0: Loading
docs/releases/1.9.txt +5 −1 Original line number Diff line number Diff line Loading @@ -177,7 +177,11 @@ Miscellaneous Features deprecated in 1.9 ========================== ... Miscellaneous ~~~~~~~~~~~~~ * The ``weak`` argument to ``django.dispatch.signals.Signal.disconnect()`` has been deprecated as it has no effect. .. removed-features-1.9: Loading
docs/topics/signals.txt +6 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ error instance is returned in the tuple pair for the receiver that raised the er Disconnecting signals ===================== .. method:: Signal.disconnect([receiver=None, sender=None, weak=True, dispatch_uid=None]) .. method:: Signal.disconnect([receiver=None, sender=None, dispatch_uid=None]) To disconnect a receiver from a signal, call :meth:`Signal.disconnect`. The arguments are as described in :meth:`.Signal.connect`. The method returns Loading @@ -287,3 +287,8 @@ may be ``None`` if ``dispatch_uid`` is used to identify the receiver. .. versionchanged:: 1.8 The boolean return value was added. .. deprecated:: 1.9 The ``weak`` argument is deprecated as it has no effect. It will be removed in Django 2.1.