Patchwork [4,of,8] mdiff: remove use of __slots__

login
register
mail settings
Submitter Pulkit Goyal
Date June 27, 2016, 1:43 p.m.
Message ID <7a1ddd9404b6290fa06e.1467034995@pulkit-goyal>
Download mbox | patch
Permalink /patch/15638/
State Not Applicable
Headers show

Comments

Pulkit Goyal - June 27, 2016, 1:43 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1466887966 25200
#      Sat Jun 25 13:52:46 2016 -0700
# Node ID 7a1ddd9404b6290fa06e3df56b53ab9f9567b591
# Parent  f07fcec2e176ee59148ba781e97d06c0bd3cab9c
mdiff: remove use of __slots__

The use of __slots__ was added way back in 2006 in 4ec58b157265.
__slots__ isn't necessary for this class.

Patch

diff -r f07fcec2e176 -r 7a1ddd9404b6 mercurial/mdiff.py
--- a/mercurial/mdiff.py	Sat Jun 25 17:40:53 2016 -0700
+++ b/mercurial/mdiff.py	Sat Jun 25 13:52:46 2016 -0700
@@ -58,10 +58,8 @@ 
         'upgrade': False,
         }
 
-    __slots__ = defaults.keys()
-
     def __init__(self, **opts):
-        for k in self.__slots__:
+        for k in self.defaults.keys():
             v = opts.get(k)
             if v is None:
                 v = self.defaults[k]