Gora Khargosh  committed 859d974

Eclipse linter. Removes some unused imports.

Signed-off-by: Gora Khargosh <>

  • Participants
  • Parent commits 3e2d461

Comments (0)

Files changed (6)

File mom/

 from struct import pack
 from mom._compat import ZERO_BYTE, get_word_alignment, EMPTY_BYTE
-from mom.builtins import b, byte_ord
+from mom.builtins import byte_ord
 def integer_byte_length_shift_counting(num):
     if num < 0:
         num = -num
     raw_bytes = EMPTY_BYTE
-    word_bits, num_bytes, max_uint, pack_type = _get_machine_alignment(num)
+    word_bits, _, max_uint, pack_type = _get_machine_alignment(num)
     pack_format = ">" + pack_type
     while num > 0:
         raw_bytes = pack(pack_format, num & max_uint) + raw_bytes

File mom/_types/

 from __future__ import absolute_import
 from array import array
-#from mom.builtins import b
 from mom.builtins import integer_byte_length, integer_bit_length
-#    _bytearray(0)
-#except NameError:
-#    class bytearray(object):
-#        def __init__(self, source=None, encoding=None, errors=None):
-#            source = source or b('')
-#            self._array = array('B', source)
-#        def __repr__(self):
-#            return repr(self._array)
-#bytearray = bytearray
 def bytearray_create(sequence):
     Creates a byte array from a given sequence.

File mom/

 from __future__ import absolute_import
+from collections import defaultdict, deque
 from functools import partial
     # Python 2.x
     cycle, repeat, groupby
 from mom.itertools import chain, starmap
-from mom.builtins import is_bytes_or_unicode, is_bytes
+from mom.builtins import is_bytes_or_unicode
 from mom._compat import range, dict_each, reduce as _reduce, next
 def _some2(predicate, iterable):
     """Alternative implementation of :func:`some`."""
     result = False
-    for x in dropwhile(complement(predicate), iterable):
+    for _ in dropwhile(complement(predicate), iterable):
         result = True
     return result
         A dictionary of counts of each element in the iterable.
-    from collections import defaultdict
     d = defaultdict(int)
     for k in iterable:
         d[k] += 1
     # Use functions that consume iterators at C speed.
     if n is None:
         # Feed the entire iterator into a zero-length deque.
-        from collections import deque
         # Advance to the empty slice starting at position n.
         s, t = s // 2, t+1
     #Repeat Rabin-Miller x times
     a = 2 #Use 2 as a base for first iteration speedup, per HAC
-    for count in range(iterations):
+    for _ in range(iterations):
         v = _pure_pow_mod(a, s, num)
         if v == 1:

File mom/os/

     :param followlinks:
         Please see the documentation for :func:`os.walk`
-    for root, dir_names, file_names in walk(
+    for root, dir_names, _ in walk(
         dir_pathname, recursive, topdown, followlinks):
         for dir_name in dir_names:
             yield absolute_path(path_join(root, dir_name))
     :param followlinks:
         Please see the documentation for :func:`os.walk`
-    for root, dir_names, file_names in walk(
+    for root, _, file_names in walk(
         dir_pathname, recursive, topdown, followlinks):
         for file_name in file_names:
             yield absolute_path(path_join(root, file_name))

File mom/

 punctuation = punctuation
 printable = printable
 whitespace = whitespace