Start incorporating type checker to GUI file#47
Conversation
| @@ -86,6 +110,7 @@ def json_difference_checker( | |||
|
|
|||
| old_job_urls = [job_post["Job Post URL"] for job_post in json_content["Job Posts"]] | |||
There was a problem hiding this comment.
Usually json_content["Job Posts"] can be None, but not in this function. Unfortunately mypy isn't clever enough to notice that, and we need to tell that to mypy manually. See python/mypy#4245
| old_job_urls = [job_post["Job Post URL"] for job_post in json_content["Job Posts"]] | |
| assert json_content["Job Posts"] is not None | |
| old_job_urls = [job_post["Job Post URL"] for job_post in json_content["Job Posts"]] |
There was a problem hiding this comment.
Can you please specify why Mypy even needs to notice that it cannot be None? We already told mypy that "it's optionally JobPost" This means that it will be 1 or 0, and in this function it will just always be 1. Why does mypy need more info?
There was a problem hiding this comment.
Also, this suggestion is marked as outdated for some reason. I cannot "commit suggestion", and it is not implemented neither in type_checker or main.
|
There's also this code, but unfortunately I cant add a review comment at it: The problem is that mypy sees this as a dict with string keys and To fix this, we can add a type hint |
Co-authored-by: Akuli <akuviljanen17@gmail.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
No description provided.