From f18ce013556c5bafe7e9c35e361deb149eef37a4 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Jul 14 2017 07:15:00 +0000 Subject: IPAOptionParser: fix dict comprehension The statement can be simplified and be more resources friendly Reviewed-By: Tomas Krizek --- diff --git a/ipapython/config.py b/ipapython/config.py index 19abfc5..6e53472 100644 --- a/ipapython/config.py +++ b/ipapython/config.py @@ -114,7 +114,10 @@ class IPAOptionParser(OptionParser): Returns all options except those with sensitive=True in the same fashion as parse_args would """ - all_opts_dict = dict([ (o.dest, o) for o in self._get_all_options() if hasattr(o, 'sensitive') ]) + all_opts_dict = { + o.dest: o for o in self._get_all_options() + if hasattr(o, 'sensitive') + } safe_opts_dict = {} for option, value in opts.__dict__.items():