Skip to content

Commit

Permalink
Used a tuple instead of a list to define __all__. (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
atombrella authored and Omer Katz committed Nov 12, 2018
1 parent 84227ec commit 5e6fcca
Show file tree
Hide file tree
Showing 35 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion kombu/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .five import python_2_unicode_compatible
from .utils.functional import ChannelPromise

__all__ = ['Object', 'MaybeChannelBound']
__all__ = ('Object', 'MaybeChannelBound')


def unpickle_dict(cls, kwargs):
Expand Down
2 changes: 1 addition & 1 deletion kombu/asynchronous/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

from kombu.utils.eventio import READ, WRITE, ERR

__all__ = ['READ', 'WRITE', 'ERR', 'Hub', 'get_event_loop', 'set_event_loop']
__all__ = ('READ', 'WRITE', 'ERR', 'Hub', 'get_event_loop', 'set_event_loop')
4 changes: 2 additions & 2 deletions kombu/asynchronous/aws/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def message_from_headers(hdr): # noqa
b'{0}: {1}'.format(*h) for h in hdr
))

__all__ = [
__all__ = (
'AsyncHTTPSConnection', 'AsyncConnection',
]
)


@python_2_unicode_compatible
Expand Down
4 changes: 2 additions & 2 deletions kombu/asynchronous/aws/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ class BotoCoreError(Exception):
get_response = _void()


__all__ = [
__all__ = (
'exceptions', 'AWSRequest', 'get_response'
]
)
2 changes: 1 addition & 1 deletion kombu/asynchronous/aws/sqs/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .queue import AsyncQueue


__all__ = ['AsyncSQSConnection']
__all__ = ('AsyncSQSConnection')


class AsyncSQSConnection(AsyncAWSQueryConnection):
Expand Down
2 changes: 1 addition & 1 deletion kombu/asynchronous/http/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from .base import Request, Headers, Response

__all__ = ['Client', 'Headers', 'Response', 'Request']
__all__ = ('Client', 'Headers', 'Response', 'Request')


def Client(hub=None, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion kombu/asynchronous/http/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
except ImportError:
from httplib import responses # noqa

__all__ = ['Headers', 'Response', 'Request']
__all__ = ('Headers', 'Response', 'Request')

PYPY = hasattr(sys, 'pypy_version_info')

Expand Down
2 changes: 1 addition & 1 deletion kombu/asynchronous/http/curl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'HEAD': pycurl.NOBODY,
}

__all__ = ['CurlClient']
__all__ = ('CurlClient')

DEFAULT_USER_AGENT = bytes_if_py2('Mozilla/5.0 (compatible; pycurl)')
EXTRA_METHODS = frozenset(['DELETE', 'OPTIONS', 'PATCH'])
Expand Down
2 changes: 1 addition & 1 deletion kombu/asynchronous/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from .timer import Timer

__all__ = ['Hub', 'get_event_loop', 'set_event_loop']
__all__ = ('Hub', 'get_event_loop', 'set_event_loop')
logger = get_logger(__name__)

_current_loop = None
Expand Down
2 changes: 1 addition & 1 deletion kombu/asynchronous/semaphore.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from kombu.five import python_2_unicode_compatible

__all__ = ['DummyLock', 'LaxBoundedSemaphore']
__all__ = ('DummyLock', 'LaxBoundedSemaphore')


@python_2_unicode_compatible
Expand Down
2 changes: 1 addition & 1 deletion kombu/asynchronous/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
except ImportError: # pragma: no cover
utc = None

__all__ = ['Entry', 'Timer', 'to_timestamp']
__all__ = ('Entry', 'Timer', 'to_timestamp')

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion kombu/clocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from .five import python_2_unicode_compatible, zip

__all__ = ['LamportClock', 'timetuple']
__all__ = ('LamportClock', 'timetuple')

R_CLOCK = '_lamport(clock={0}, timestamp={1}, id={2} {3!r})'

Expand Down
4 changes: 2 additions & 2 deletions kombu/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
except ImportError: # pragma: no cover
from dummy_thread import get_ident # noqa

__all__ = ['Broadcast', 'maybe_declare', 'uuid',
__all__ = ('Broadcast', 'maybe_declare', 'uuid',
'itermessages', 'send_reply',
'collect_replies', 'insured', 'drain_consumer',
'eventloop']
'eventloop')

#: Prefetch count can't exceed short.
PREFETCH_COUNT_MAX = 0xFFFF
Expand Down
2 changes: 1 addition & 1 deletion kombu/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .entity import Exchange, Queue
from .five import items

__all__ = ['Publisher', 'Consumer']
__all__ = ('Publisher', 'Consumer')

# XXX compat attribute
entry_to_queue = Queue.from_dict
Expand Down
4 changes: 2 additions & 2 deletions kombu/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
_encoders = {}
_decoders = {}

__all__ = ['register', 'encoders', 'get_encoder',
'get_decoder', 'compress', 'decompress']
__all__ = ('register', 'encoders', 'get_encoder',
'get_decoder', 'compress', 'decompress')


def register(encoder, decoder, content_type, aliases=[]):
Expand Down
2 changes: 1 addition & 1 deletion kombu/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from .utils.objects import cached_property
from .utils.url import as_url, parse_url, quote, urlparse

__all__ = ['Connection', 'ConnectionPool', 'ChannelPool']
__all__ = ('Connection', 'ConnectionPool', 'ChannelPool')

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion kombu/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
DELIVERY_MODES = {'transient': TRANSIENT_DELIVERY_MODE,
'persistent': PERSISTENT_DELIVERY_MODE}

__all__ = ['Exchange', 'Queue', 'binding', 'maybe_delivery_mode']
__all__ = ('Exchange', 'Queue', 'binding', 'maybe_delivery_mode')

INTERNAL_EXCHANGE_PREFIX = ('amq.',)

Expand Down
4 changes: 2 additions & 2 deletions kombu/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

from kombu.five import python_2_unicode_compatible

__all__ = [
__all__ = (
'KombuError', 'OperationalError',
'NotBoundError', 'MessageStateError', 'TimeoutError',
'LimitExceeded', 'ConnectionLimitExceeded',
'ChannelLimitExceeded', 'ConnectionError', 'ChannelError',
'VersionMismatch', 'SerializerNotInstalled', 'ResourceError',
'SerializationError', 'EncodeError', 'DecodeError', 'HttpError',
'InconsistencyError',
]
)


class KombuError(Exception):
Expand Down
2 changes: 1 addition & 1 deletion kombu/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .utils.functional import maybe_evaluate
from .utils.objects import cached_property

__all__ = ['LogMixin', 'LOG_LEVELS', 'get_loglevel', 'setup_logging']
__all__ = ('LogMixin', 'LOG_LEVELS', 'get_loglevel', 'setup_logging')

try:
LOG_LEVELS = dict(logging._nameToLevel)
Expand Down
2 changes: 1 addition & 1 deletion kombu/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .serialization import loads
from .utils.functional import dictfilter

__all__ = ['Message']
__all__ = ('Message')

ACK_STATES = {'ACK', 'REJECTED', 'REQUEUED'}
IS_PYPY = hasattr(sys, 'pypy_version_info')
Expand Down
2 changes: 1 addition & 1 deletion kombu/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .serialization import dumps, prepare_accept_content
from .utils.functional import ChannelPromise, maybe_list

__all__ = ['Exchange', 'Queue', 'Producer', 'Consumer']
__all__ = ('Exchange', 'Queue', 'Producer', 'Consumer')


@python_2_unicode_compatible
Expand Down
2 changes: 1 addition & 1 deletion kombu/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .utils.limits import TokenBucket
from .utils.objects import cached_property

__all__ = ['ConsumerMixin', 'ConsumerProducerMixin']
__all__ = ('ConsumerMixin', 'ConsumerProducerMixin')

logger = get_logger(__name__)
debug, info, warn, error = logger.debug, logger.info, logger.warn, logger.error
Expand Down
2 changes: 1 addition & 1 deletion kombu/pidbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
you give each node a unique node name!
"""

__all__ = ['Node', 'Mailbox']
__all__ = ('Node', 'Mailbox')
logger = get_logger(__name__)
debug, error = logger.debug, logger.error

Expand Down
4 changes: 2 additions & 2 deletions kombu/pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from .utils.compat import register_after_fork
from .utils.functional import lazy

__all__ = ['ProducerPool', 'PoolGroup', 'register_group',
'connections', 'producers', 'get_limit', 'set_limit', 'reset']
__all__ = ('ProducerPool', 'PoolGroup', 'register_group',
'connections', 'producers', 'get_limit', 'set_limit', 'reset')
_limit = [10]
_groups = []
use_global_limit = object()
Expand Down
2 changes: 1 addition & 1 deletion kombu/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from .utils.compat import entrypoints
from .utils.encoding import bytes_to_str, str_to_bytes, bytes_t

__all__ = ['pickle', 'loads', 'dumps', 'register', 'unregister']
__all__ = ('pickle', 'loads', 'dumps', 'register', 'unregister')
SKIP_DECODE = frozenset(['binary', 'ascii-8bit'])
TRUSTED_CONTENT = frozenset(['application/data', 'application/text'])

Expand Down
2 changes: 1 addition & 1 deletion kombu/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .connection import maybe_channel
from .five import Empty, monotonic

__all__ = ['SimpleQueue', 'SimpleBuffer']
__all__ = ('SimpleQueue', 'SimpleBuffer')


class SimpleBase(object):
Expand Down
2 changes: 1 addition & 1 deletion kombu/transport/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from kombu.utils.objects import cached_property
from kombu.utils.time import maybe_s_to_ms

__all__ = ['Message', 'StdChannel', 'Management', 'Transport']
__all__ = ('Message', 'StdChannel', 'Management', 'Transport')

RABBITMQ_QUEUE_ARGUMENTS = { # type: Mapping[str, Tuple[str, Callable]]
'expires': ('x-expires', maybe_s_to_ms),
Expand Down
4 changes: 2 additions & 2 deletions kombu/transport/virtual/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
Empty, binding_key_t, queue_binding_t,
)

__all__ = [
__all__ = (
'Base64', 'NotEquivalentError', 'UndeliverableWarning', 'BrokerState',
'QoS', 'Message', 'AbstractChannel', 'Channel', 'Management', 'Transport',
'Empty', 'binding_key_t', 'queue_binding_t',
]
)
4 changes: 2 additions & 2 deletions kombu/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from .objects import cached_property
from .uuid import uuid

__all__ = [
__all__ = (
'EqualityDict', 'uuid', 'maybe_list',
'fxrange', 'fxrangemax', 'retry_over_time',
'emergency_dump_state', 'cached_property',
'register_after_fork', 'reprkwargs', 'reprcall',
'symbol_by_name', 'nested', 'fileno', 'maybe_fileno',
]
)
2 changes: 1 addition & 1 deletion kombu/utils/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kombu.five import items, python_2_unicode_compatible
from kombu.log import get_logger

__all__ = ['setup_logging', 'Logwrapped']
__all__ = ('setup_logging', 'Logwrapped')


def setup_logging(loglevel=logging.DEBUG, loggers=['kombu.connection',
Expand Down
2 changes: 1 addition & 1 deletion kombu/utils/eventio.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from . import fileno
from .compat import detect_environment

__all__ = ['poll']
__all__ = ('poll')

_selectf = __select__.select
_selecterr = __select__.error
Expand Down
4 changes: 2 additions & 2 deletions kombu/utils/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

from .encoding import safe_repr as _safe_repr

__all__ = [
__all__ = (
'LRUCache', 'memoize', 'lazy', 'maybe_evaluate',
'is_list', 'maybe_list', 'dictfilter',
]
)

KEYWORD_MARK = object()

Expand Down
2 changes: 1 addition & 1 deletion kombu/utils/limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from kombu.five import monotonic

__all__ = ['TokenBucket']
__all__ = ('TokenBucket')


class TokenBucket(object):
Expand Down
4 changes: 2 additions & 2 deletions kombu/utils/scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

from .imports import symbol_by_name

__all__ = [
__all__ = (
'FairCycle', 'priority_cycle', 'round_robin_cycle', 'sorted_cycle',
]
)

CYCLE_ALIASES = {
'priority': 'kombu.utils.scheduling:priority_cycle',
Expand Down
2 changes: 1 addition & 1 deletion kombu/utils/time.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Time Utilities."""
from __future__ import absolute_import, unicode_literals

__all__ = ['maybe_s_to_ms']
__all__ = ('maybe_s_to_ms')


def maybe_s_to_ms(v):
Expand Down

0 comments on commit 5e6fcca

Please sign in to comment.