From 816d3212d15ba297aa3a234d7874974d9f39b4bd Mon Sep 17 00:00:00 2001 From: Dmitry Pribysh Date: Mon, 19 Oct 2015 17:44:10 +0300 Subject: Add checker for membership rules and tests Idea of checking is very simple: value used to the right of the 'in' operator should support membership test protocol (i.e. define either __contains__ or __iter__ or __getitem__). Fixes issue #589. --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index b25533b..957ed56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ ChangeLog for Pylint -------------------- -- + * Add a new error, 'unsupported-membership-test', emitted when value + to the right of the 'in' operator doesn't support membership test + protocol (i.e. doesn't define __contains__/__iter__/__getitem__) + * Add new errors, 'not-an-iterable', emitted when non-iterable value is used in an iterating context (starargs, for-statement, comprehensions, etc), and 'not-a-mapping', emitted when non-mapping -- cgit v1.2.1