Skip to content

Commit

Permalink
Additional simple magic return types (#3805)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Mar 30, 2023
1 parent f4cda31 commit 44ae323
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/ruff_python_stdlib/src/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FxHashMap<&'static str, &'static str>> =
Lazy::new(|| {
FxHashMap::from_iter([
Expand All @@ -216,5 +216,12 @@ pub static SIMPLE_MAGIC_RETURN_TYPES: Lazy<FxHashMap<&'static str, &'static str>
("__int__", "int"),
("__float__", "float"),
("__index__", "int"),
("__setattr__", "None"),
("__delattr__", "None"),
("__setitem__", "None"),
("__delitem__", "None"),
("__set__", "None"),
("__instancecheck__", "bool"),
("__subclasscheck__", "bool"),
])
});

0 comments on commit 44ae323

Please sign in to comment.