diff --git a/doc/data/messages/u/unidiomatic-typecheck/bad.py b/doc/data/messages/u/unidiomatic-typecheck/bad.py new file mode 100644 index 0000000000..e1e56103d1 --- /dev/null +++ b/doc/data/messages/u/unidiomatic-typecheck/bad.py @@ -0,0 +1,3 @@ +test_score = {"Biology": 95, "History": 80} +if type(test_score) is dict: # [unidiomatic-typecheck] + pass diff --git a/doc/data/messages/u/unidiomatic-typecheck/good.py b/doc/data/messages/u/unidiomatic-typecheck/good.py new file mode 100644 index 0000000000..c50c6e4ebc --- /dev/null +++ b/doc/data/messages/u/unidiomatic-typecheck/good.py @@ -0,0 +1,3 @@ +test_score = {"Biology": 95, "History": 80} +if isinstance(test_score, dict): + pass diff --git a/doc/data/messages/u/unidiomatic-typecheck/related.rst b/doc/data/messages/u/unidiomatic-typecheck/related.rst new file mode 100644 index 0000000000..25b9129a70 --- /dev/null +++ b/doc/data/messages/u/unidiomatic-typecheck/related.rst @@ -0,0 +1,2 @@ +* `Builtin function type() `_ +* `Builtin function isinstance() `_