Skip to content

Commit 323a2fc

Browse files
authored
Add example for unidiomatic-typecheck (#6152)
1 parent e724596 commit 323a2fc

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test_score = {"Biology": 95, "History": 80}
2+
if type(test_score) is dict: # [unidiomatic-typecheck]
3+
pass
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test_score = {"Biology": 95, "History": 80}
2+
if isinstance(test_score, dict):
3+
pass
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* `Builtin function type() <https://docs.python.org/3/library/functions.html#type>`_
2+
* `Builtin function isinstance() <https://docs.python.org/3/library/functions.html#isinstance>`_

0 commit comments

Comments
 (0)