Skip to content

Commit

Permalink
Remove last remaining pylint comments (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Apr 4, 2024
1 parent 4b702c8 commit 9d29d06
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/persistent/mapping.py
Expand Up @@ -141,7 +141,7 @@ def popitem(self):
# ``data`` when we have ``_container`` instead

@default
def data(self): # pylint:disable=method-hidden
def data(self):
# We don't want to cause a write on read, so we're careful not to
# do anything that would cause us to become marked as changed, however,
# if we're modified, then the saved record will have data, not
Expand Down
10 changes: 0 additions & 10 deletions src/persistent/persistence.py
Expand Up @@ -29,14 +29,6 @@
'PersistentPy',
]

# We use implementation details of PickleCachePy
# pylint:disable=protected-access
# we have lots of not-quite-correct continuation indentation.
# TODO: Fix that in a whitespace-only commit.
# pylint:disable=bad-continuation
# There are a few places we need to work with exact types.
# pylint:disable=unidiomatic-typecheck

_INITIAL_SERIAL = _ZERO


Expand Down Expand Up @@ -346,7 +338,6 @@ def __getstate__(self):
if idict is not None:
# TODO: Convert to a dictionary comprehension, avoid the
# intermediate list.
# pylint:disable=consider-using-dict-comprehension
d = dict([x for x in idict.items()
if not x[0].startswith('_p_') and
not x[0].startswith('_v_')])
Expand Down Expand Up @@ -588,7 +579,6 @@ def _p_is_in_cache(self, jar=None):
return None

def __repr__(self):
# pylint:disable=broad-except
p_repr_str = ''
p_repr = getattr(type(self), '_p_repr', None)
if p_repr is not None:
Expand Down
5 changes: 0 additions & 5 deletions src/persistent/picklecache.py
Expand Up @@ -34,11 +34,6 @@
'PickleCachePy',
]

# We're tightly coupled to the PersistentPy implementation and access
# its internals.
# pylint:disable=protected-access


_OGA = object.__getattribute__
_OSA = object.__setattr__

Expand Down
7 changes: 2 additions & 5 deletions src/persistent/ring.py
Expand Up @@ -12,9 +12,6 @@
#
##############################################################################

# pylint:disable=inherit-non-class,no-self-argument,redefined-builtin,c-extension-no-member
# pylint:disable=protected-access

from zope.interface import Interface
from zope.interface import implementer

Expand All @@ -32,7 +29,7 @@ class IRing(Interface):
implementations by explaining assumptions and performance requirements.
"""

def __len__(): # pylint:disable=no-method-argument
def __len__():
"""Return the number of persistent objects stored in the ring.
Should be constant time.
Expand Down Expand Up @@ -74,7 +71,7 @@ def move_to_head(object):
allowed.
"""

def __iter__(): # pylint:disable=no-method-argument
def __iter__():
"""Iterate over each persistent object in the ring, in the order of
least recently used to most recently used.
Expand Down
2 changes: 1 addition & 1 deletion src/persistent/tests/test__compat.py
Expand Up @@ -23,7 +23,7 @@


class TestCOptimizationsFuncs(unittest.TestCase):
# pylint:disable=protected-access

def setUp(self):
self.env_val = os.environ.get('PURE_PYTHON', self)
self.orig_pypy = compat.PYPY
Expand Down
3 changes: 0 additions & 3 deletions src/persistent/tests/test_docs.py
Expand Up @@ -16,9 +16,6 @@
"""


# disable: accessing protected members, too many methods
# pylint: disable=W0212,R0904

import doctest
import os.path
import unittest
Expand Down
2 changes: 0 additions & 2 deletions src/persistent/tests/test_list.py
Expand Up @@ -24,8 +24,6 @@
l1 = [0]
l2 = [0, 1]

# pylint:disable=protected-access


class OtherList:
def __init__(self, initlist):
Expand Down
2 changes: 0 additions & 2 deletions src/persistent/tests/test_mapping.py
Expand Up @@ -17,8 +17,6 @@
from persistent.tests.utils import copy_test


# pylint:disable=blacklisted-name, protected-access

class Test_default(unittest.TestCase):

def _getTargetClass(self):
Expand Down
7 changes: 0 additions & 7 deletions src/persistent/tests/test_persistence.py
Expand Up @@ -21,13 +21,6 @@
from persistent.tests.utils import skipIfNoCExtension


# pylint:disable=R0904,W0212,E1101
# pylint:disable=attribute-defined-outside-init,too-many-lines
# pylint:disable=blacklisted-name,useless-object-inheritance
# Hundreds of unused jar and OID vars make this useless
# pylint:disable=unused-variable


class _Persistent_Base:

def _getTargetClass(self):
Expand Down
3 changes: 0 additions & 3 deletions src/persistent/tests/test_picklecache.py
Expand Up @@ -19,9 +19,6 @@
from persistent.tests.utils import skipIfNoCExtension


# pylint:disable=protected-access,too-many-lines,too-many-public-methods
# pylint:disable=attribute-defined-outside-init,redefined-outer-name

_marker = object()


Expand Down
2 changes: 0 additions & 2 deletions src/persistent/tests/test_ring.py
Expand Up @@ -16,8 +16,6 @@
from .. import ring


# pylint:disable=protected-access

class DummyPersistent:
_p_oid = None
_Persistent__ring = None
Expand Down
2 changes: 0 additions & 2 deletions src/persistent/tests/test_timestamp.py
Expand Up @@ -211,7 +211,6 @@ class Instant:
def __init__(self):
from persistent import timestamp as MUT
self.MUT = MUT
# pylint:disable=protected-access
self.orig_maxint = MUT._MAXINT

self.is_32_bit_hash = self.orig_maxint == self.MAX_32_BITS
Expand All @@ -231,7 +230,6 @@ def __init__(self):

@contextmanager
def _use_hash(self, maxint, c_long):
# pylint:disable=protected-access
try:
self.MUT._MAXINT = maxint
self.MUT.c_long = c_long
Expand Down
4 changes: 1 addition & 3 deletions src/persistent/timestamp.py
Expand Up @@ -105,8 +105,7 @@ def __init__(self, *args):
raise TypeError('Raw must be 8 octets')
self._raw = raw
elif len(args) == 6:
self._raw = _makeRaw(
*args) # pylint:disable=no-value-for-parameter
self._raw = _makeRaw(*args)
# Note that we don't preserve the incoming arguments in
# self._elements, we derive them from the raw value. This is
# because the incoming seconds value could have more precision than
Expand Down Expand Up @@ -162,7 +161,6 @@ def laterThan(self, other):
"""
if not isinstance(other, self.__class__):
raise ValueError()
# pylint:disable=protected-access
if self._raw > other._raw:
return self
a, b = struct.unpack('>II', other._raw)
Expand Down

0 comments on commit 9d29d06

Please sign in to comment.