From 44ae3237b8bb5379beb874cd24b31435b03502b8 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Thu, 30 Mar 2023 18:27:49 +0530 Subject: [PATCH] Additional simple magic return types (#3805) --- crates/ruff_python_stdlib/src/typing.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/ruff_python_stdlib/src/typing.rs b/crates/ruff_python_stdlib/src/typing.rs index 19b3b399fc..e1abeba65f 100644 --- a/crates/ruff_python_stdlib/src/typing.rs +++ b/crates/ruff_python_stdlib/src/typing.rs @@ -198,7 +198,7 @@ pub const PEP_585_BUILTINS_ELIGIBLE: &[&[&str]] = &[ &["typing_extensions", "Type"], ]; -// See: https://github.com/JelleZijlstra/autotyping/blob/f65b5ee3a8fdb77999f84b4c87edb996e25269a5/autotyping/autotyping.py#L69-L84 +// See: https://github.com/JelleZijlstra/autotyping/blob/0adba5ba0eee33c1de4ad9d0c79acfd737321dd9/autotyping/autotyping.py#L69-L91 pub static SIMPLE_MAGIC_RETURN_TYPES: Lazy> = Lazy::new(|| { FxHashMap::from_iter([ @@ -216,5 +216,12 @@ pub static SIMPLE_MAGIC_RETURN_TYPES: Lazy ("__int__", "int"), ("__float__", "float"), ("__index__", "int"), + ("__setattr__", "None"), + ("__delattr__", "None"), + ("__setitem__", "None"), + ("__delitem__", "None"), + ("__set__", "None"), + ("__instancecheck__", "bool"), + ("__subclasscheck__", "bool"), ]) });