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

Fix mypy errors in course.py #195

Merged
merged 1 commit into from
Aug 25, 2024
Merged

Fix mypy errors in course.py #195

merged 1 commit into from
Aug 25, 2024

Conversation

tianyizheng02
Copy link
Contributor

Run mypy with --strict flag and fix resulting mypy errors in course.py

Contributes to #45 by fixing existing type hint errors prior to introducing mypy to the repo.

Before:

> mypy --strict pittapi/course.py
pittapi/course.py:251: error: Argument 2 to "_get_section_details" has incompatible type "str | int"; expected "str"  [arg-type]
pittapi/course.py:361: error: Missing type parameters for generic type "dict"  [type-arg]
pittapi/course.py:362: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
pittapi/course.py:365: error: Missing type parameters for generic type "dict"  [type-arg]
pittapi/course.py:366: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
pittapi/course.py:369: error: Missing type parameters for generic type "dict"  [type-arg]
pittapi/course.py:373: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
pittapi/course.py:376: error: Missing type parameters for generic type "dict"  [type-arg]
pittapi/course.py:380: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
pittapi/course.py:383: error: Missing type parameters for generic type "dict"  [type-arg]
pittapi/course.py:387: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
pittapi/course.py:399: error: Missing type parameters for generic type "dict"  [type-arg]
pittapi/course.py:412: error: Returning Any from function declared to return "str"  [no-any-return]
Found 13 errors in 1 file (checked 1 source file)

After:

> mypy --strict pittapi/course.py 
Success: no issues found in 1 source file

@tianyizheng02 tianyizheng02 merged commit 24c165c into dev Aug 25, 2024
4 checks passed
@tianyizheng02 tianyizheng02 deleted the mypy-course branch August 25, 2024 21:51
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

Successfully merging this pull request may close these issues.

2 participants