sourcery
sourcery copied to clipboard
identity-comprehension; remove-unnecessary-cast when using pathlib
Checklist
- [X] I have searched the Sourcery documentation for the issue, and found nothing
- [X] I have checked there are no open bugs referencing the same bug or problem
Description
I got mypy error if i accept sourcery suggestion.
because the return type is changed to list[Path]
In this case, I think sourcery suggestion should be like this
Code snippet that reproduces issue
def get_files_by_suffix_in_dir(path: str, suffix: str) -> list[str]:
return [str(path) for path in Path(path).glob(f"*{suffix}")]
Debug Information
IDE Version:
VSCODE 1.78.2Sourcery Version:
sourcery 1.3.0Operating system and Version:
Windows 10
Thanks for raising this - have reproduced it