changeset 38280:49ef1539b84e

templater: mark .keytype as a private attribute
author Yuya Nishihara <yuya@tcha.org>
date Fri, 23 Mar 2018 22:31:58 +0900
parents fb874fc1d9b4
children cf8d210dfac4
files mercurial/templateutil.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templateutil.py	Mon Mar 19 00:23:20 2018 +0900
+++ b/mercurial/templateutil.py	Fri Mar 23 22:31:58 2018 +0900
@@ -183,17 +183,17 @@
         self._values = values
         self._makemap = makemap
         self._joinfmt = joinfmt
-        self.keytype = keytype  # hint for 'x in y' where type(x) is unresolved
+        self._keytype = keytype  # hint for 'x in y' where type(x) is unresolved
 
     def contains(self, context, mapping, item):
-        item = unwrapastype(context, mapping, item, self.keytype)
+        item = unwrapastype(context, mapping, item, self._keytype)
         return item in self._values
 
     def getmember(self, context, mapping, key):
         # TODO: maybe split hybrid list/dict types?
         if not util.safehasattr(self._values, 'get'):
             raise error.ParseError(_('not a dictionary'))
-        key = unwrapastype(context, mapping, key, self.keytype)
+        key = unwrapastype(context, mapping, key, self._keytype)
         return self._wrapvalue(key, self._values.get(key))
 
     def getmin(self, context, mapping):