[PATCH 1 of 2] smartset: convert set to list lazily
Jun Wu
quark at fb.com
Sun Feb 19 01:43:59 UTC 2017
Excerpts from Martin von Zweigbergk's message of 2017-02-18 17:03:12 -0800:
> @@ -205,5 +215,5 @@ class baseset(abstractsmartset):
>
> def __nonzero__(self):
> - return bool(self._list)
> + return bool(len(self))
>
> Could delete method, I think. Just FYI.
No, because abstractsmartset implements __nonzero__ to
"raise NotImplementedError()".
I think that's reasonable as it will force people to not forget overriding
the __nonzero__ implementation, to make things more explicit.
More information about the Mercurial-devel
mailing list