[PATCH] Remove useless temporary variable
- From: Vincent Legoll <vincent legoll gmail com>
- To: meld-list <meld-list gnome org>, Kai Willadsen <kai willadsen gmail com>
- Subject: [PATCH] Remove useless temporary variable
- Date: Thu, 12 Mar 2009 21:27:54 +0100
Pass directly the callable returned by lambda to setattr()
--
Vincent Legoll
Index: historyentry.py
===================================================================
--- historyentry.py (révision 1255)
+++ historyentry.py (copie de travail)
@@ -196,15 +196,14 @@
history_id = gobject.property(get_history_id, __set_history_id, type=str)
max_saved = gobject.property(get_history_length, set_history_length, type=int)
+
try:
import gconf
except ImportError:
- do_nothing = lambda *args: None
for m in ('_save_history', '_load_history', '_get_gconf_client'):
- setattr(HistoryEntry, m, do_nothing)
+ setattr(HistoryEntry, m, lambda *args: None)
-
def _expand_filename(filename, default_dir):
if not filename:
return ""
@@ -472,6 +471,4 @@
try:
import gnomevfs
except ImportError:
- do_nothing = lambda *args: None
- setattr(HistoryFileEntry, '_setup_dnd', do_nothing)
-
+ setattr(HistoryFileEntry, '_setup_dnd', lambda *args: None)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]