mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 22:01:47 +00:00
Additional simple magic return types (#3805)
This commit is contained in:
parent
f4cda31708
commit
44ae3237b8
1 changed files with 8 additions and 1 deletions
|
@ -198,7 +198,7 @@ pub const PEP_585_BUILTINS_ELIGIBLE: &[&[&str]] = &[
|
||||||
&["typing_extensions", "Type"],
|
&["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>> =
|
pub static SIMPLE_MAGIC_RETURN_TYPES: Lazy<FxHashMap<&'static str, &'static str>> =
|
||||||
Lazy::new(|| {
|
Lazy::new(|| {
|
||||||
FxHashMap::from_iter([
|
FxHashMap::from_iter([
|
||||||
|
@ -216,5 +216,12 @@ pub static SIMPLE_MAGIC_RETURN_TYPES: Lazy<FxHashMap<&'static str, &'static str>
|
||||||
("__int__", "int"),
|
("__int__", "int"),
|
||||||
("__float__", "float"),
|
("__float__", "float"),
|
||||||
("__index__", "int"),
|
("__index__", "int"),
|
||||||
|
("__setattr__", "None"),
|
||||||
|
("__delattr__", "None"),
|
||||||
|
("__setitem__", "None"),
|
||||||
|
("__delitem__", "None"),
|
||||||
|
("__set__", "None"),
|
||||||
|
("__instancecheck__", "bool"),
|
||||||
|
("__subclasscheck__", "bool"),
|
||||||
])
|
])
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue