Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
👋 Hello there
Could not figure out why my type checker (pyright for that matter) was failing in my own code.
It turns out that some typings in pycocotools are wrong.
Namely :
COCOeval.eval is an entirely different dict from
_EvaluationResult, as it can be seen here : https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/cocoeval.py#L411As such, I renamed the original
_EvaluationResultinto_ImageEvaluationResultand defined a new typed dict with the original name. Note that we could keep the original typed dict as is and create a new typed dict named something like_AccumulatedEvaluationResult, I don't have a preference.I also could see that Params.areaRng is not a list, it's a list of list, as it can be seen here : https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/cocoeval.py#L509
Note that it's actually either an int or a float. not sure if I should put
int | floator simplyfloatin that case.