We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 59d7e74 commit 438b831Copy full SHA for 438b831
python_toolbox/cute_testing.py
@@ -40,8 +40,6 @@ def __init__(self, exception_type=Exception, text='',
40
exception is of the exact `exception_type` specified, and not a
41
subclass of it.
42
'''
43
- ContextManager.__init__(self)
44
-
45
self.exception_type = exception_type
46
'''The type of exception that should be raised.'''
47
python_toolbox/monkeypatch_copy_reg.py
@@ -8,7 +8,6 @@
8
9
import copy_reg
10
import types
11
-import __builtin__
12
13
from python_toolbox import import_tools
14
python_toolbox/os_tools.py
@@ -9,6 +9,7 @@
def start_file(path):
+ '''Open a file by launching the program that handles its kind.'''
assert os.path.exists(path)
15
if sys.platform.startswith('linux'): # Linux:
python_toolbox/queue_tools.py
@@ -50,7 +50,7 @@ def iterate(queue, block=False, limit_to_original_size=False,
50
"`_prefetch_if_no_qsize=True` to have the entire queue "
51
"prefetched before yielding the items."
52
)
53
- for i in xrange(queue.qsize()):
+ for _ in xrange(queue.qsize()):
54
try:
55
yield queue.get(block=block)
56
except queue_module.Empty:
python_toolbox/sequence_tools.py
@@ -7,10 +7,8 @@
7
import itertools
from python_toolbox.nifty_collections import Counter
-from python_toolbox import caching
from python_toolbox import math_tools
from python_toolbox.infinity import infinity
-from python_toolbox.third_party import abc
from python_toolbox.third_party import abcs_collection
16
python_toolbox/sys_tools.py
@@ -6,10 +6,8 @@
6
from __future__ import with_statement
-import os
import sys
import cStringIO
-import subprocess
from python_toolbox.context_managers import (ContextManager,
BlankContextManager)
python_toolbox/version_info.py
@@ -28,9 +28,9 @@ class VersionInfo(tuple):
28
_fields = ('major', 'minor', 'micro')
29
30
31
- def __new__(_cls, major, minor, micro):
+ def __new__(cls, major, minor, micro):
32
'''Create new instance of `VersionInfo(major, minor, micro)`.'''
33
- return tuple.__new__(_cls, (major, minor, micro))
+ return tuple.__new__(cls, (major, minor, micro))
34
35
36
@classmethod
@@ -54,12 +54,12 @@ def _asdict(self):
return OrderedDict(zip(self._fields, self))
57
- def _replace(_self, **kwargs):
+ def _replace(self, **kwargs):
58
59
Make a `VersionInfo` object replacing specified fields with new values.
60
61
result = \
62
- _self._make(map(kwargs.pop, ('major', 'minor', 'micro'),_self))
+ self._make(map(kwargs.pop, ('major', 'minor', 'micro'), self))
63
if kwargs:
64
raise ValueError('Got unexpected field names: %r' % kwargs.keys())
65
return result
python_toolbox/zip_tools.py
@@ -12,7 +12,7 @@
import fnmatch
-def zip_folder(folder, zip_path, ignored_patterns=[]):
+def zip_folder(folder, zip_path, ignored_patterns=()):
17
Zip `folder` into a zip file specified by `zip_path`.
18
0 commit comments