Skip to content

Commit a74b584

Browse files
committed
Fixes for pylint
1 parent b3d0737 commit a74b584

File tree

6 files changed

+24
-12
lines changed

6 files changed

+24
-12
lines changed

.pylintrc

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,15 @@ disable=print-statement,
127127
dict-items-not-iterating,
128128
dict-keys-not-iterating,
129129
dict-values-not-iterating,
130-
inconsistent-return-statements
130+
inconsistent-return-statements,
131+
no-name-in-module,
132+
invalid-name,
133+
abstract-method,
134+
protected-access,
135+
redefined-argument-from-local,
136+
no-staticmethod-decorator,
137+
super-init-not-called,
138+
ungrouped-imports
131139

132140
# Enable the message, report, category or checker with the given id(s). You can
133141
# either give multiple identifier separated by comma (,) or put this option
@@ -218,7 +226,10 @@ contextmanager-decorators=contextlib.contextmanager
218226
# List of members which are set dynamically and missed by pylint inference
219227
# system, and so shouldn't trigger E1101 when accessed. Python regular
220228
# expressions are accepted.
221-
generated-members=
229+
generated-members=bisect_key_left,
230+
bisect_key_right,
231+
bisect_key,
232+
irange_key
222233

223234
# Tells whether missing members accessed in mixin class should be ignored. A
224235
# mixin class is detected if its name ends with "mixin" (case insensitive).
@@ -335,7 +346,7 @@ ignore-docstrings=yes
335346
ignore-imports=no
336347

337348
# Minimum lines number of a similarity.
338-
min-similarity-lines=4
349+
min-similarity-lines=6
339350

340351

341352
[BASIC]
@@ -518,7 +529,7 @@ max-branches=25
518529
max-locals=30
519530

520531
# Maximum number of parents for a class (see R0901).
521-
max-parents=7
532+
max-parents=10
522533

523534
# Maximum number of public methods for a class (see R0904).
524535
max-public-methods=20

README.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ Python Sorted Containers
33

44
.. todo::
55

6-
* Add __delitem__ to sorted dict views?
7-
* Rename github repo
86
* Update coverage
9-
* Pass pylint
107
* Update development page with test and coverage output.
8+
* Rename github repo
119
* Replace bintrees in
1210
* https://github.com/astropy/astropy
1311
* https://github.com/netzob/netzob

docs/sorteddict.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ SortedItemsView
6767
:show-inheritance:
6868

6969
.. automethod:: __getitem__
70-
.. automethod:: __delitem__
7170

7271

7372
SortedValuesView
@@ -77,4 +76,3 @@ SortedValuesView
7776
:show-inheritance:
7877

7978
.. automethod:: __getitem__
80-
.. automethod:: __delitem__

sortedcontainers/sorteddict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ def values(self):
333333

334334

335335
class _NotGiven(object):
336+
# pylint: disable=too-few-public-methods
336337
def __repr__(self):
337338
return '<not-given>'
338339

sortedcontainers/sortedlist.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* :class:`SortedKeyList`
1414
1515
"""
16+
# pylint: disable=too-many-lines
1617
from __future__ import print_function
1718

1819
from bisect import bisect_left, bisect_right, insort
@@ -30,9 +31,9 @@
3031
from sys import hexversion
3132

3233
if hexversion < 0x03000000:
33-
from itertools import imap as map
34-
from itertools import izip as zip
35-
reduce = reduce
34+
from itertools import imap as map # pylint: disable=redefined-builtin
35+
from itertools import izip as zip # pylint: disable=redefined-builtin
36+
reduce = reduce # pylint: disable=undefined-variable
3637
try:
3738
from thread import get_ident
3839
except ImportError:
@@ -49,6 +50,7 @@
4950

5051
def recursive_repr(fillvalue='...'):
5152
"Decorator to make a repr function return fillvalue for a recursive call."
53+
# pylint: disable=missing-docstring
5254
# Copied from reprlib in Python 3
5355
# https://hg.python.org/cpython/file/3.6/Lib/reprlib.py
5456

@@ -185,6 +187,7 @@ def __new__(cls, iterable=None, key=None):
185187
:return: sorted list or sorted-key list instance
186188
187189
"""
190+
# pylint: disable=unused-argument
188191
if key is None:
189192
return object.__new__(cls)
190193
else:

sortedcontainers/sortedset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ def pop(self, index=-1):
435435
:raises IndexError: if index is out of range
436436
437437
"""
438+
# pylint: disable=arguments-differ
438439
value = self._list.pop(index)
439440
self._set.remove(value)
440441
return value

0 commit comments

Comments
 (0)