drivendataorg / drivendataorg/cloudpathlib
Slash notation causes mypy to throw an error
- Dominant language
- Python
- Stars
- 628
- Forks
- 88
- Avg merge
- 17h 28m
- Merged PRs (30d)
- 2
Description
cloudpathlib: 0.19.0
Python: 3.12
mypy: 1.11.2
When doing the following:
```python
path = cloudpathlib.S3Path("s3://somebucket") / some_string / some_path / something_else
```
Mypy throws the following error:
```mypy
error: Unsupported operand types for / ("S3Path" and "AnyPath") [operator]
error: Unsupported operand types for / ("S3Path" and "S3Path") [operator]
note: Right operand is of type "Path | CloudPath | AnyPath | S3Path"
error: Unsupported left operand type for / ("None") [operator]
note: Left operand is of type "Path | S3Path | None"
```
In my opinion this is valid code. The result obviously ought to be an S3Path object merged from the original S3Path object, a string, another path-like object (could be a relative PosixPath even) and something totally different, as long as it can be interpreted as a path component.
Contributor guide
Assessment
This issue has not been assessed yet.