Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracer.py has incomplete type annotations #151

Open
smcpeak opened this issue Jan 26, 2024 · 0 comments
Open

tracer.py has incomplete type annotations #151

smcpeak opened this issue Jan 26, 2024 · 0 comments

Comments

@smcpeak
Copy link
Contributor

smcpeak commented Jan 26, 2024

Although frida_tools/tracer.py has some type annotations, they are not complete, and mypy issues many complaints:

$ mypy frida_tools/tracer.py
frida_tools/tracer.py:27: error: Need type annotation for "_attributes_by_thread_id" (hint: "_attributes_by_thread_id: Dict[<type>, <type>] = ...")  [var-annotated]
frida_tools/tracer.py:166: error: Value of type "Optional[tuple[str, Union[list[str], Pattern[Any], int, str]]]" is not indexable  [index]
frida_tools/tracer.py:176: error: Argument 1 to "start_trace" of "Tracer" has incompatible type "Optional[Session]"; expected "Session"  [arg-type]
[...]
frida_tools/tracer.py:829: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
Found 48 errors in 1 file (checked 1 source file)

$ mypy --version
mypy 1.5.1 (compiled: yes)

I've added annotations to my local copy of this file that make mypy happy, and I could submit those as a PR. But the story is similar for other files in frida_tools, and I'm not sure if I want to annotate all of them, or whether any of this is considered relevant or useful by the Frida developers.

The above is with the latest frida-tools (c10668f).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant