diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-09-06 16:31:13 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-09-06 16:31:13 -0700 |
commit | 3d57e14df7ba5f14a634295caf3b2e60da50bfe2 (patch) | |
tree | 4903bcb79a49ad714a1a9129765b9545405c9978 /python/gevent/_ffi/callback.py | |
parent | ac32b24b2a011292b704a3f27e8fd08a7ae9424b (diff) | |
download | yt-local-3d57e14df7ba5f14a634295caf3b2e60da50bfe2.tar.lz yt-local-3d57e14df7ba5f14a634295caf3b2e60da50bfe2.tar.xz yt-local-3d57e14df7ba5f14a634295caf3b2e60da50bfe2.zip |
Remove windows python distribution from repo and add requirements.txt
Diffstat (limited to 'python/gevent/_ffi/callback.py')
-rw-r--r-- | python/gevent/_ffi/callback.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/python/gevent/_ffi/callback.py b/python/gevent/_ffi/callback.py deleted file mode 100644 index df59a9f..0000000 --- a/python/gevent/_ffi/callback.py +++ /dev/null @@ -1,58 +0,0 @@ -from __future__ import absolute_import, print_function - -__all__ = [ - 'callback', -] - - -# For times when *args is captured but often not passed (empty), -# we can avoid keeping the new tuple that was created for *args -# around by using a constant. -_NOARGS = () - - -class callback(object): - - __slots__ = ('callback', 'args') - - def __init__(self, cb, args): - self.callback = cb - self.args = args or _NOARGS - - def stop(self): - self.callback = None - self.args = None - - close = stop - - # Note that __nonzero__ and pending are different - # bool() is used in contexts where we need to know whether to schedule another callback, - # so it's true if it's pending or currently running - # 'pending' has the same meaning as libev watchers: it is cleared before actually - # running the callback - - def __nonzero__(self): - # it's nonzero if it's pending or currently executing - # NOTE: This depends on loop._run_callbacks setting the args property - # to None. - return self.args is not None - __bool__ = __nonzero__ - - @property - def pending(self): - return self.callback is not None - - def _format(self): - return '' - - def __repr__(self): - result = "<%s at 0x%x" % (self.__class__.__name__, id(self)) - if self.pending: - result += " pending" - if self.callback is not None: - result += " callback=%r" % (self.callback, ) - if self.args is not None: - result += " args=%r" % (self.args, ) - if self.callback is None and self.args is None: - result += " stopped" - return result + ">" |