do not shadow builtins as variable names

This commit is contained in:
Eli Schwartz 2019-06-14 02:28:36 -04:00
parent c18eb0cb8c
commit 824f909627
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
2 changed files with 6 additions and 6 deletions

View File

@ -97,8 +97,8 @@ class LRFContentObject(LRFObject):
tag_map = {}
def __init__(self, bytes, objects):
self.stream = bytes if hasattr(bytes, 'read') else io.BytesIO(bytes)
def __init__(self, byts, objects):
self.stream = byts if hasattr(byts, 'read') else io.BytesIO(byts)
length = self.stream_size()
self.objects = objects
self._contents = []

View File

@ -56,13 +56,13 @@ fields = {
}
def normalize(str):
def normalize(s):
"""
The normalize-space function returns the argument string with whitespace
normalized by stripping leading and trailing whitespace and replacing
sequences of whitespace characters by a single space.
"""
return whitespace.sub(' ', str).strip()
return whitespace.sub(' ', s).strip()
class MetaCollector:
@ -75,9 +75,9 @@ class MetaCollector:
self._content = []
self.dowrite = True
def write(self, str):
def write(self, s):
if self.dowrite:
self._content.append(str)
self._content.append(s)
def content(self):
return ''.join(self._content)