Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Add type hint for mapping proxies
  • Loading branch information
Marcel Weiler committed Nov 15, 2023
commit 2504078b9255e457767b6d8748abceef5246e8cb
4 changes: 2 additions & 2 deletions mypy/stubgenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def is_staticmethod(self, class_info: ClassInfo | None, name: str, obj: object)
if class_info is None:
return False
elif self.is_c_module:
raw_lookup = getattr(class_info.cls, "__dict__") # noqa: B009
raw_lookup: Mapping[str, Any] = getattr(class_info.cls, "__dict__") # noqa: B009
raw_value = raw_lookup.get(name, obj)
return type(raw_value).__name__ == "staticmethod"
Comment thread
WeilerMarcel marked this conversation as resolved.
Outdated
else:
Expand Down Expand Up @@ -721,7 +721,7 @@ def generate_class_stub(self, class_name: str, cls: type, output: list[str]) ->
The result lines will be appended to 'output'. If necessary, any
required names will be added to 'imports'.
"""
raw_lookup = getattr(cls, "__dict__") # noqa: B009
raw_lookup: Mapping[str, Any] = getattr(cls, "__dict__") # noqa: B009
items = self.get_members(cls)
if self.resort_members:
items = sorted(items, key=lambda x: method_name_sort_key(x[0]))
Expand Down