Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
Kajongg
Commits
4a028bee
Commit
4a028bee
authored
Apr 07, 2021
by
Wolfgang Rohdewald
Browse files
pylint: initialize lists as [], not as None
otherwise pylint makes wrong deductions
parent
db344fd7
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/kajonggtest.py
View file @
4a028bee
...
...
@@ -342,7 +342,7 @@ def pairs(data):
class
CSV
(
StrMixin
):
"""represent kajongg.csv"""
knownCommits
=
None
knownCommits
=
[]
def
__init__
(
self
):
self
.
findKnownCommits
()
...
...
@@ -368,7 +368,7 @@ class CSV(StrMixin):
@
classmethod
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
:
...
...
src/rule.py
View file @
4a028bee
...
...
@@ -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):
@
staticmethod
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
...
...
src/sound.py
View file @
4a028bee
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment