From 80a97fbc9bc9aa35d5ade7d668ec035f1e435f9d Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 29 Mar 2018 15:43:48 +0545 Subject: [PATCH] core: Rename Sender.put() to Sender.send(). Been annoying me for months. --- docs/api.rst | 2 +- mitogen/core.py | 4 ++-- tests/call_function_test.py | 2 +- tests/receiver_test.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 53ff60ac..50c5bdab 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1027,7 +1027,7 @@ Sender Class Send :py:data:`_DEAD` to the remote end, causing :py:meth:`ChannelError` to be raised in any waiting thread. - .. py:method:: put (data) + .. py:method:: send (data) Send `data` to the remote end. diff --git a/mitogen/core.py b/mitogen/core.py index 8218280d..1e3b891a 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -384,9 +384,9 @@ class Sender(object): ) ) - def put(self, data): + def send(self, data): """Send `data` to the remote.""" - _vv and IOLOG.debug('%r.put(%r..)', self, data[:100]) + _vv and IOLOG.debug('%r.send(%r..)', self, data[:100]) self.context.send( Message.pickled( data, diff --git a/tests/call_function_test.py b/tests/call_function_test.py index 301b7798..d66864b4 100644 --- a/tests/call_function_test.py +++ b/tests/call_function_test.py @@ -34,7 +34,7 @@ def func_accepts_returns_context(context): def func_accepts_returns_sender(sender): - sender.put(123) + sender.send(123) sender.close() return sender diff --git a/tests/receiver_test.py b/tests/receiver_test.py index 1d8c0c7b..3d67cf80 100644 --- a/tests/receiver_test.py +++ b/tests/receiver_test.py @@ -7,7 +7,7 @@ import testlib def yield_stuff_then_die(sender): for x in xrange(5): - sender.put(x) + sender.send(x) sender.close() return 10