"""
from __future__ import absolute_import, division, print_function, with_statement
+import collections
import functools
import operator
import sys
else:
return False
-# in python 2.6+ this could be a collections.namedtuple
-
-
-class Arguments(tuple):
- """The result of a yield expression whose callback had more than one
- argument (or keyword arguments).
-
- The `Arguments` object can be used as a tuple ``(args, kwargs)``
- or an object with attributes ``args`` and ``kwargs``.
- """
- __slots__ = ()
-
- def __new__(cls, args, kwargs):
- return tuple.__new__(cls, (args, kwargs))
-
- args = property(operator.itemgetter(0))
- kwargs = property(operator.itemgetter(1))
+Arguments = collections.namedtuple('Arguments', ['args', 'kwargs'])
return sockets
if hasattr(socket, 'AF_UNIX'):
- def bind_unix_socket(file, mode=int('600', 8), backlog=128):
+ def bind_unix_socket(file, mode=0o600, backlog=128):
"""Creates a listening unix socket.
If a socket with the given name already exists, it will be deleted.
------------
Instances of the following classes may be used in yield expressions
- in the generator.
+ in the generator.
.. autoclass:: Task
Other classes
-------------
- .. autoclass:: Arguments
+ .. class:: Arguments
+
+ The result of a yield expression whose callback had more than one
+ argument (or keyword arguments).
+
+ The `Arguments` object can be used as a tuple ``(args, kwargs)``
+ or an object with attributes ``args`` and ``kwargs``.