From e6fbfd5aab0d8fd9873ebe04f318180287872285 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 20 Dec 2016 10:46:53 -0800 Subject: Use dict's iter methods This patch replaces a number of uses of dict.items, dict.values, and dict.keys with their iterative siblings. The advantage of using the iterator version is that they don't copy the keys, values, or items, but simply return references. This reduces memory usage and may speed up the these operations a bit. --- alot/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'alot/__main__.py') diff --git a/alot/__main__.py b/alot/__main__.py index 34c36b52..829983c5 100644 --- a/alot/__main__.py +++ b/alot/__main__.py @@ -24,7 +24,7 @@ class SubcommandOptions(usage.Options): def as_argparse_opts(self): optstr = '' - for k, v in self.items(): + for k, v in self.iteritems(): # flags translate int value 0 or 1.. if k in [a[0] for a in self.optFlags]: # if flag optstr += ('--%s ' % k) * v -- cgit v1.2.3