Commit 4a028bee authored by Wolfgang Rohdewald's avatar Wolfgang Rohdewald
Browse files

pylint: initialize lists as [], not as None

otherwise pylint makes wrong deductions
parent db344fd7
......@@ -342,7 +342,7 @@ def pairs(data):
class CSV(StrMixin):
"""represent kajongg.csv"""
knownCommits = None
knownCommits = []
def __init__(self):
......@@ -368,7 +368,7 @@ class CSV(StrMixin):
def findKnownCommits(cls):
"""find known commits"""
if cls.knownCommits is None:
if not cls.knownCommits:
cls.knownCommits = set()
for branch in subprocess.check_output(b'git branch'.split()).decode().split('\n'):
if 'detached' not in branch and 'no branch' not in branch:
......@@ -1022,7 +1022,7 @@ class PredefinedRuleset(Ruleset):
"""special code for loading rules from program code instead of from the database"""
classes = set() # only those will be playable
preRulesets = None
preRulesets = []
def __init__(self, name=None):
Ruleset.__init__(self, name or 'general predefined ruleset')
......@@ -1030,7 +1030,7 @@ class PredefinedRuleset(Ruleset):
def rulesets():
"""a list of instances for all predefined rulesets"""
if PredefinedRuleset.preRulesets is None:
if not PredefinedRuleset.preRulesets:
PredefinedRuleset.preRulesets = [
x() for x in sorted(PredefinedRuleset.classes, key=lambda x: x.__name__)]
return PredefinedRuleset.preRulesets
......@@ -179,7 +179,7 @@ class Voice(StrMixin):
destination, no tarfile is written, only the content. It makes
only sense to cache the voice in a tarfile at source."""
__availableVoices = None
__availableVoices = []
md5sumLength = 32 # magical constant
def __init__(self, directory, content=None):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment