# HG changeset patch # User Pierre-Yves David # Date 2017-03-15 22:08:45 # Node ID 7aac35ada1cbd32b21b64560e3dc77d1a92ffaa6 # Parent 6e1c79578e5cb619b838f0f4683dbed1cb65d4a9 match: explicitly tests for None Changeset 6168d4b93634 removed the mutable default value, but did not explicitly tested for None. Such implicit testing can introduce semantic and performance issue. We move to an explicit testing for None as recommended by PEP8: https://www.python.org/dev/peps/pep-0008/#programming-recommendations diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -117,8 +117,10 @@ class match(object): the same directory '' - a pattern of the specified default type """ - include = include or [] - exclude = exclude or [] + if include is None: + include = [] + if exclude is None: + exclude = [] self._root = root self._cwd = cwd