diff options
author | Jarrod Millman <jarrod.millman@gmail.com> | 2020-12-12 10:00:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-12 10:00:38 -0800 |
commit | 812f115e9b98bcefc8fdb8a3479e3cd32468ac5e (patch) | |
tree | e351614d02677098d6d4e820b858d427efc713af /networkx/utils | |
parent | d970b73df3900b730602c3fac3db820e693a72e2 (diff) | |
download | networkx-812f115e9b98bcefc8fdb8a3479e3cd32468ac5e.tar.gz |
Deprecate utils.misc.consume (#4449)
Diffstat (limited to 'networkx/utils')
-rw-r--r-- | networkx/utils/misc.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/networkx/utils/misc.py b/networkx/utils/misc.py index 2c4816df..5d4f11dd 100644 --- a/networkx/utils/misc.py +++ b/networkx/utils/misc.py @@ -255,6 +255,11 @@ def arbitrary_element(iterable): def consume(iterator): "Consume the iterator entirely." # Feed the entire iterator into a zero-length deque. + msg = ( + "consume is deprecated and will be removed in version 3.0. " + "Use ``collections.deque(iterator, maxlen=0)`` instead." + ) + warnings.warn(msg, DeprecationWarning, stacklevel=2) deque(iterator, maxlen=0) |