summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2016-03-20 20:54:26 +0100
committerMartin Basti <mbasti@redhat.com>2016-03-22 10:20:51 +0100
commit195e50b93b63e4f30ce83dbcfef278727d48aea2 (patch)
tree17fe09843b3d2b76f73052f6dd0f9843c7c23325
parentd46cd5d956d1c03b863bf90d0fd0ff4870448183 (diff)
Pylint: use list comprehension instead of iteration
Iteration over indexes without calling enumeration fuction is not pythonic and should not be used. In this case iteration can be replaced by list comprehension. Fixing this allows to enable pylint consider-using-enumerate check. Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
-rw-r--r--ipaserver/dcerpc.py5
-rw-r--r--pylintrc1
2 files changed, 1 insertions, 5 deletions
diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py
index 6b62b5fea..a93e8ddb2 100644
--- a/ipaserver/dcerpc.py
+++ b/ipaserver/dcerpc.py
@@ -784,11 +784,8 @@ class DomainValidator(object):
return info
def string_to_array(what):
- blob = [0] * len(what)
+ return [ord(v) for v in what]
- for i in range(len(what)):
- blob[i] = ord(what[i])
- return blob
class TrustDomainInstance(object):
diff --git a/pylintrc b/pylintrc
index e469128f4..d75ca13de 100644
--- a/pylintrc
+++ b/pylintrc
@@ -72,7 +72,6 @@ disable=
not-an-iterable,
singleton-comparison,
misplaced-comparison-constant,
- consider-using-enumerate,
unneeded-not,
not-a-mapping,
singleton-comparison