diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-26 20:14:00 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-02-27 13:28:32 -0500 |
commit | 116e3492f2945d46db44d921f0b5eb03c58d5c93 (patch) | |
tree | 8c709212c7658170414c503b009a7991fae6d56a /gdb/gdbarch.py | |
parent | 05e4e893736c870ad5d2fd4e7ea8d95a94cdff3c (diff) | |
download | fsf-binutils-gdb-116e3492f2945d46db44d921f0b5eb03c58d5c93.zip fsf-binutils-gdb-116e3492f2945d46db44d921f0b5eb03c58d5c93.tar.gz fsf-binutils-gdb-116e3492f2945d46db44d921f0b5eb03c58d5c93.tar.bz2 |
gdb: gdbarch*.py, copyright.py: add type annotations
Add type annotations to gdbarch*.py to fix all errors shown by pyright.
There is one change in copyright.py too, to fix this one:
/home/simark/src/binutils-gdb/gdb/gdbarch.py
/home/simark/src/binutils-gdb/gdb/gdbarch.py:206:13 - error: Type of "copyright" is partially unknown
Type of "copyright" is "(tool: Unknown, description: Unknown) -> str" (reportUnknownMemberType)
Change-Id: Ia109b53e267f6e2f5bd79a1288d0d5c9508c9ac4
Reviewed-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/gdbarch.py')
-rwxr-xr-x | gdb/gdbarch.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py index d1ac414..93b1e8b 100755 --- a/gdb/gdbarch.py +++ b/gdb/gdbarch.py @@ -25,10 +25,10 @@ import textwrap # `gdbarch_types.components`. import gdbarch_components # noqa: F401 # type: ignore import gdbcopyright -from gdbarch_types import Function, Info, Value, components +from gdbarch_types import Component, Function, Info, Value, components -def indentation(n_columns): +def indentation(n_columns: int): """Return string with tabs and spaces to indent line to N_COLUMNS.""" return "\t" * (n_columns // 8) + " " * (n_columns % 8) @@ -38,12 +38,12 @@ copyright = gdbcopyright.copyright( ) -def info(c): +def info(c: Component): "Filter function to only allow Info components." return type(c) is Info -def not_info(c): +def not_info(c: Component): "Filter function to omit Info components." return type(c) is not Info |