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

Sync typeshed #11905

Merged
merged 6 commits into from
Jan 28, 2022
Merged

Sync typeshed #11905

merged 6 commits into from
Jan 28, 2022

Conversation

hauntsaninja
Copy link
Collaborator

Source commit:
python/typeshed@9116b29

@github-actions

This comment has been minimized.

@hauntsaninja
Copy link
Collaborator Author

hauntsaninja commented Jan 5, 2022

A lot of primer is from fixing the PathLike regression (although looks like it's getting clipped, so download the diffs from the job to see everything)

@github-actions

This comment has been minimized.

@hauntsaninja
Copy link
Collaborator Author

This error is a little less friendly, but seems fine

-_testDictWithStarStarSpecialCase.py:4: error: Argument 1 to "update" of "dict" has incompatible type "Dict[int, int]"; expected "Mapping[int, str]"
+_testDictWithStarStarSpecialCase.py:4: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[int, int]"; expected "SupportsKeysAndGetItem[int, str]"

hauntsaninja pushed a commit to hauntsaninja/mypy that referenced this pull request Jan 5, 2022
I don't know that these have caught any real issues in the last couple
years, however, the standard library ones have been a bit of a pain,
most recently in python#11905.

Jukka was okay removing the stdlib samples two years ago, see
python#8838 (comment)
We now have tooling like mypy primer that runs mypy over a much larger
and more varied corpus of code on every PR.

The other samples haven't caused me much bother, but except for crawl2,
they're all very simple. I don't think they provide us much value,
unless they have sentimental or historical value.
@hauntsaninja
Copy link
Collaborator Author

I propose removing stdlib samples altogether in #11906

@hauntsaninja
Copy link
Collaborator Author

hauntsaninja commented Jan 5, 2022

The asyncio ones are interesting.
testAsyncioGatherPreciseType seems unfortunate, seems like maybe type inference is different now that asyncio.sleep is a coroutine.
However, testErrorUsingDifferentFutureTypeAndSetFutureDifferentInternalType I think it now catches a bug in the test: asyncio.coroutine is missing the @ so it doesn't decorate. cc @sobolevn since you might be amused by this :-)

@github-actions

This comment has been minimized.

@sobolevn
Copy link
Member

sobolevn commented Jan 5, 2022

Thanks for the ping: I've updated this test here

This error is a little less friendly, but seems fine
-_testDictWithStarStarSpecialCase.py:4: error: Argument 1 to "update" of "dict" has incompatible type "Dict[int, int]"; expected "Mapping[int, str]"
+_testDictWithStarStarSpecialCase.py:4: error: Argument 1 to "update" of "MutableMapping" has incompatible type "Dict[int, int]"; expected "SupportsKeysAndGetItem[int, str]"

I've also partially covered this problem in #11693
(It depends whether this is a real .update() call or ** which mimics .update())

AlexWaygood added a commit to AlexWaygood/mypy that referenced this pull request Jan 5, 2022
As discussed in python#11895, mypy's test suite currently does not pass a mypy self-check when run on Windows. This should hopefully be fixed by python/typeshed#6812, but running a self-check on Windows as part of the CI tests should help avoid this issue in the future.

This new CI test should hopefully fail until python#11905 is merged, confirming the diagnosis of the problem that I made in python#11895. Once python#11905 is merged, it should hopefully then pass, allowing this PR to be merged.
hauntsaninja added a commit that referenced this pull request Jan 8, 2022
I don't know that these have caught any real issues in the last couple
years, however, the standard library ones have been a bit of a pain,
most recently in #11905.

Jukka was okay removing the stdlib samples two years ago, see
#8838 (comment)
We now have tooling like mypy primer that runs mypy over a much larger
and more varied corpus of code on every PR.

The other samples haven't caused me much bother (except for crawl,
which I removed in #9375), but except for crawl2, they're all very simple.
I don't think they provide us much value, unless they have sentimental or
historical value.
@github-actions

This comment has been minimized.

@hauntsaninja
Copy link
Collaborator Author

hauntsaninja commented Jan 11, 2022

Okay, just got the asyncio.gather regression left. I don't fully understand what's causing the regression, the relevant change is probably to asyncio.sleep: https://github.com/python/mypy/pull/11905/files#diff-04a6e8e72f5ccf748662e8786571059eccb8154c46a42135c26127862e756870R244

@sobolevn
Copy link
Member

@hauntsaninja asyncio.sleep was changed by me.

I did it so it will match its definition in: https://github.com/python/cpython/blob/7357ac94f84ae768c39a6bccf1a3f5c4e8dc8c75/Lib/asyncio/tasks.py#L593

@hauntsaninja
Copy link
Collaborator Author

@sobolevn the typeshed change itself makes sense and I'm fine with.

The part I'm missing is why mypy's type inference is worse with the new definition of asyncio.sleep. If this is exposing a bug in mypy, I don't want to just change the test so that things are green. Does the change in type inference makes sense to you?

In fact, I just found something really weird.

So the test expects the following to reveal Future[list[Any]], with this PR, the test reveals Future[Any]

reveal_type(asyncio.gather(*[asyncio.sleep(1), asyncio.sleep(1)]))

But really weirdly, if you add another reveal_type, mypy is once again able to infer the better Future[list[Any]] type. That is, the following shows Future[list[Any]] for the outer reveal_type.

reveal_type(asyncio.gather(*[reveal_type(asyncio.sleep(1)), asyncio.sleep(1)]))

@sobolevn
Copy link
Member

Does the change in type inference makes sense to you?

No, it looks like a bug 😞

tushar-deepsource pushed a commit to DeepSourceCorp/mypy that referenced this pull request Jan 20, 2022
I don't know that these have caught any real issues in the last couple
years, however, the standard library ones have been a bit of a pain,
most recently in python#11905.

Jukka was okay removing the stdlib samples two years ago, see
python#8838 (comment)
We now have tooling like mypy primer that runs mypy over a much larger
and more varied corpus of code on every PR.

The other samples haven't caused me much bother (except for crawl,
which I removed in python#9375), but except for crawl2, they're all very simple.
I don't think they provide us much value, unless they have sentimental or
historical value.
@JelleZijlstra JelleZijlstra mentioned this pull request Jan 20, 2022
@hauntsaninja
Copy link
Collaborator Author

Just marking that test as xfail for now, we can file an issue

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

rich (https://github.com/willmcgugan/rich)
+ rich/console.py:1818: error: Incompatible return value type (got "Tuple[str, Optional[int], Dict[str, Any]]", expected "Tuple[str, int, Dict[str, Any]]")

boostedblob (https://github.com/hauntsaninja/boostedblob)
- boostedblob/path.py:350: error: Argument 1 to "stat" has incompatible type "LocalPath"; expected "Union[int, Union[str, bytes, PathLike[str], PathLike[bytes]]]"
- boostedblob/path.py:457: error: Argument 1 to "isdir" has incompatible type "LocalPath"; expected "Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int]"
- boostedblob/path.py:481: error: Argument 1 to "isfile" has incompatible type "LocalPath"; expected "Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int]"
- boostedblob/path.py:505: error: Argument 1 to "exists" has incompatible type "LocalPath"; expected "Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int]"
- boostedblob/share.py:26: error: No overload variant of "abspath" matches argument type "LocalPath"
- boostedblob/share.py:26: note: Possible overload variants:
- boostedblob/share.py:26: note:     def [AnyStr in (str, bytes)] abspath(path: PathLike[AnyStr]) -> AnyStr
- boostedblob/share.py:26: note:     def [AnyStr in (str, bytes)] abspath(path: AnyStr) -> AnyStr
- boostedblob/read.py:93: error: No overload variant of "open" matches argument types "LocalPath", "str"
- boostedblob/read.py:93: note: Possible overload variants:
- boostedblob/read.py:93: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['r+'], Literal['+r'], Literal['rt+'], Literal['r+t'], Literal['+rt'], Literal['tr+'], Literal['t+r'], Literal['+tr'], Literal['w+'], Literal['+w'], Literal['wt+'], Literal['w+t'], Literal['+wt'], Literal['tw+'], Literal['t+w'], Literal['+tw'], Literal['a+'], Literal['+a'], Literal['at+'], Literal['a+t'], Literal['+at'], Literal['ta+'], Literal['t+a'], Literal['+ta'], Literal['x+'], Literal['+x'], Literal['xt+'], Literal['x+t'], Literal['+xt'], Literal['tx+'], Literal['t+x'], Literal['+tx']], Union[Literal['w'], Literal['wt'], Literal['tw'], Literal['a'], Literal['at'], Literal['ta'], Literal['x'], Literal['xt'], Literal['tx']], Union[Literal['r'], Literal['rt'], Literal['tr'], Literal['U'], Literal['rU'], Literal['Ur'], Literal['rtU'], Literal['rUt'], Literal['Urt'], Literal['trU'], Literal['tUr'], Literal['Utr']]] = ..., buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> TextIOWrapper
- boostedblob/read.py:93: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']]], buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> FileIO
- boostedblob/read.py:93: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedRandom
- boostedblob/read.py:93: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedWriter
- boostedblob/read.py:93: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedReader
- boostedblob/read.py:93: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']]], buffering: int, encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BinaryIO
- boostedblob/read.py:93: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: str, buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]
- boostedblob/read.py:142: error: No overload variant of "open" matches argument types "LocalPath", "str"
- boostedblob/read.py:142: note: Possible overload variants:
- boostedblob/read.py:142: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['r+'], Literal['+r'], Literal['rt+'], Literal['r+t'], Literal['+rt'], Literal['tr+'], Literal['t+r'], Literal['+tr'], Literal['w+'], Literal['+w'], Literal['wt+'], Literal['w+t'], Literal['+wt'], Literal['tw+'], Literal['t+w'], Literal['+tw'], Literal['a+'], Literal['+a'], Literal['at+'], Literal['a+t'], Literal['+at'], Literal['ta+'], Literal['t+a'], Literal['+ta'], Literal['x+'], Literal['+x'], Literal['xt+'], Literal['x+t'], Literal['+xt'], Literal['tx+'], Literal['t+x'], Literal['+tx']], Union[Literal['w'], Literal['wt'], Literal['tw'], Literal['a'], Literal['at'], Literal['ta'], Literal['x'], Literal['xt'], Literal['tx']], Union[Literal['r'], Literal['rt'], Literal['tr'], Literal['U'], Literal['rU'], Literal['Ur'], Literal['rtU'], Literal['rUt'], Literal['Urt'], Literal['trU'], Literal['tUr'], Literal['Utr']]] = ..., buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> TextIOWrapper
- boostedblob/read.py:142: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']]], buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> FileIO
- boostedblob/read.py:142: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedRandom
- boostedblob/read.py:142: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedWriter
- boostedblob/read.py:142: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedReader
- boostedblob/read.py:142: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']]], buffering: int, encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BinaryIO
- boostedblob/read.py:142: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: str, buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]
- boostedblob/listing.py:177: error: No overload variant of "abspath" matches argument type "LocalPath"
- boostedblob/listing.py:177: note: Possible overload variants:
- boostedblob/listing.py:177: note:     def [AnyStr in (str, bytes)] abspath(path: PathLike[AnyStr]) -> AnyStr
- boostedblob/listing.py:177: note:     def [AnyStr in (str, bytes)] abspath(path: AnyStr) -> AnyStr
- boostedblob/listing.py:213: error: No overload variant of "listdir" matches argument type "LocalPath"
- boostedblob/listing.py:213: note: Possible overload variants:
- boostedblob/listing.py:213: note:     def listdir(path: Optional[str] = ...) -> List[str]
- boostedblob/listing.py:213: note:     def listdir(path: bytes) -> List[bytes]
- boostedblob/listing.py:213: note:     def listdir(path: int) -> List[str]
- boostedblob/listing.py:213: note:     def listdir(path: PathLike[str]) -> List[str]
- boostedblob/listing.py:252: error: No overload variant of "abspath" matches argument type "LocalPath"
- boostedblob/listing.py:252: note: Possible overload variants:
- boostedblob/listing.py:252: note:     def [AnyStr in (str, bytes)] abspath(path: PathLike[AnyStr]) -> AnyStr
- boostedblob/listing.py:252: note:     def [AnyStr in (str, bytes)] abspath(path: AnyStr) -> AnyStr
- boostedblob/listing.py:295: error: Value of type variable "AnyStr" of "walk" cannot be "LocalPath"
- boostedblob/listing.py:297: error: Argument 1 to "LocalPath" has incompatible type "LocalPath"; expected "str"
- boostedblob/listing.py:297: error: Unsupported operand types for / ("LocalPath" and "LocalPath")
- boostedblob/listing.py:375: error: No overload variant of "dirname" matches argument type "LocalPath"
- boostedblob/listing.py:375: note: Possible overload variants:
- boostedblob/listing.py:375: note:     def [AnyStr in (str, bytes)] dirname(p: PathLike[AnyStr]) -> AnyStr
- boostedblob/listing.py:375: note:     def [AnyStr in (str, bytes)] dirname(p: AnyStr) -> AnyStr
- boostedblob/delete.py:68: error: Argument 1 to "remove" has incompatible type "LocalPath"; expected "Union[str, bytes, PathLike[str], PathLike[bytes]]"
- boostedblob/delete.py:68: note: "LocalPath" is missing following "PathLike" protocol member:
- boostedblob/delete.py:68: note:     __class_getitem__
- boostedblob/delete.py:68: note: Following member(s) of "LocalPath" have conflicts:
- boostedblob/delete.py:68: note:     Expected:
- boostedblob/delete.py:68: note:         def __fspath__(self) -> bytes
- boostedblob/delete.py:68: note:     Got:
- boostedblob/delete.py:68: note:         def __fspath__(self) -> str
- boostedblob/delete.py:152: error: Argument 1 to "rmtree" has incompatible type "LocalPath"; expected "Union[bytes, Union[str, PathLike[str]]]"
- boostedblob/write.py:87: error: Argument 1 to "makedirs" has incompatible type "LocalPath"; expected "Union[str, bytes, PathLike[str], PathLike[bytes]]"
- boostedblob/write.py:87: note: "LocalPath" is missing following "PathLike" protocol member:
- boostedblob/write.py:87: note:     __class_getitem__
- boostedblob/write.py:87: note: Following member(s) of "LocalPath" have conflicts:
- boostedblob/write.py:87: note:     Expected:
- boostedblob/write.py:87: note:         def __fspath__(self) -> bytes
- boostedblob/write.py:87: note:     Got:
- boostedblob/write.py:87: note:         def __fspath__(self) -> str
- boostedblob/write.py:88: error: No overload variant of "open" matches argument types "LocalPath", "str"
- boostedblob/write.py:88: note: Possible overload variants:
- boostedblob/write.py:88: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['r+'], Literal['+r'], Literal['rt+'], Literal['r+t'], Literal['+rt'], Literal['tr+'], Literal['t+r'], Literal['+tr'], Literal['w+'], Literal['+w'], Literal['wt+'], Literal['w+t'], Literal['+wt'], Literal['tw+'], Literal['t+w'], Literal['+tw'], Literal['a+'], Literal['+a'], Literal['at+'], Literal['a+t'], Literal['+at'], Literal['ta+'], Literal['t+a'], Literal['+ta'], Literal['x+'], Literal['+x'], Literal['xt+'], Literal['x+t'], Literal['+xt'], Literal['tx+'], Literal['t+x'], Literal['+tx']], Union[Literal['w'], Literal['wt'], Literal['tw'], Literal['a'], Literal['at'], Literal['ta'], Literal['x'], Literal['xt'], Literal['tx']], Union[Literal['r'], Literal['rt'], Literal['tr'], Literal['U'], Literal['rU'], Literal['Ur'], Literal['rtU'], Literal['rUt'], Literal['Urt'], Literal['trU'], Literal['tUr'], Literal['Utr']]] = ..., buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> TextIOWrapper
- boostedblob/write.py:88: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']]], buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> FileIO
- boostedblob/write.py:88: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedRandom
- boostedblob/write.py:88: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedWriter
- boostedblob/write.py:88: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedReader
- boostedblob/write.py:88: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']]], buffering: int, encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BinaryIO
- boostedblob/write.py:88: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: str, buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]
- boostedblob/write.py:223: error: Argument 1 to "makedirs" has incompatible type "LocalPath"; expected "Union[str, bytes, PathLike[str], PathLike[bytes]]"
- boostedblob/write.py:223: note: "LocalPath" is missing following "PathLike" protocol member:
- boostedblob/write.py:223: note:     __class_getitem__
- boostedblob/write.py:223: note: Following member(s) of "LocalPath" have conflicts:
- boostedblob/write.py:223: note:     Expected:
- boostedblob/write.py:223: note:         def __fspath__(self) -> bytes
- boostedblob/write.py:223: note:     Got:
- boostedblob/write.py:223: note:         def __fspath__(self) -> str
- boostedblob/write.py:224: error: No overload variant of "open" matches argument types "LocalPath", "str"
- boostedblob/write.py:224: note: Possible overload variants:
- boostedblob/write.py:224: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['r+'], Literal['+r'], Literal['rt+'], Literal['r+t'], Literal['+rt'], Literal['tr+'], Literal['t+r'], Literal['+tr'], Literal['w+'], Literal['+w'], Literal['wt+'], Literal['w+t'], Literal['+wt'], Literal['tw+'], Literal['t+w'], Literal['+tw'], Literal['a+'], Literal['+a'], Literal['at+'], Literal['a+t'], Literal['+at'], Literal['ta+'], Literal['t+a'], Literal['+ta'], Literal['x+'], Literal['+x'], Literal['xt+'], Literal['x+t'], Literal['+xt'], Literal['tx+'], Literal['t+x'], Literal['+tx']], Union[Literal['w'], Literal['wt'], Literal['tw'], Literal['a'], Literal['at'], Literal['ta'], Literal['x'], Literal['xt'], Literal['tx']], Union[Literal['r'], Literal['rt'], Literal['tr'], Literal['U'], Literal['rU'], Literal['Ur'], Literal['rtU'], Literal['rUt'], Literal['Urt'], Literal['trU'], Literal['tUr'], Literal['Utr']]] = ..., buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> TextIOWrapper
- boostedblob/write.py:224: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']]], buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> FileIO
- boostedblob/write.py:224: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedRandom
- boostedblob/write.py:224: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedWriter
- boostedblob/write.py:224: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedReader
- boostedblob/write.py:224: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']]], buffering: int, encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BinaryIO
- boostedblob/write.py:224: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: str, buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]
- boostedblob/copying.py:110: error: Argument 1 to "makedirs" has incompatible type "LocalPath"; expected "Union[str, bytes, PathLike[str], PathLike[bytes]]"
- boostedblob/copying.py:110: note: "LocalPath" is missing following "PathLike" protocol member:
- boostedblob/copying.py:110: note:     __class_getitem__
- boostedblob/copying.py:110: note: Following member(s) of "LocalPath" have conflicts:
- boostedblob/copying.py:110: note:     Expected:
- boostedblob/copying.py:110: note:         def __fspath__(self) -> bytes
- boostedblob/copying.py:110: note:     Got:
- boostedblob/copying.py:110: note:         def __fspath__(self) -> str
- boostedblob/copying.py:111: error: Value of type variable "_PathT" of "copyfile" cannot be "LocalPath"
- boostedblob/copying.py:111: error: Argument 1 to "copyfile" has incompatible type "LocalPath"; expected "Union[str, PathLike[str]]"
- boostedblob/copying.py:111: note: "LocalPath" is missing following "PathLike" protocol member:
- boostedblob/copying.py:111: note:     __class_getitem__
- boostedblob/cli.py:294: error: No overload variant of "open" matches argument types "LocalPath", "str"
- boostedblob/cli.py:294: note: Possible overload variants:
- boostedblob/cli.py:294: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['r+'], Literal['+r'], Literal['rt+'], Literal['r+t'], Literal['+rt'], Literal['tr+'], Literal['t+r'], Literal['+tr'], Literal['w+'], Literal['+w'], Literal['wt+'], Literal['w+t'], Literal['+wt'], Literal['tw+'], Literal['t+w'], Literal['+tw'], Literal['a+'], Literal['+a'], Literal['at+'], Literal['a+t'], Literal['+at'], Literal['ta+'], Literal['t+a'], Literal['+ta'], Literal['x+'], Literal['+x'], Literal['xt+'], Literal['x+t'], Literal['+xt'], Literal['tx+'], Literal['t+x'], Literal['+tx']], Union[Literal['w'], Literal['wt'], Literal['tw'], Literal['a'], Literal['at'], Literal['ta'], Literal['x'], Literal['xt'], Literal['tx']], Union[Literal['r'], Literal['rt'], Literal['tr'], Literal['U'], Literal['rU'], Literal['Ur'], Literal['rtU'], Literal['rUt'], Literal['Urt'], Literal['trU'], Literal['tUr'], Literal['Utr']]] = ..., buffering: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> TextIOWrapper
- boostedblob/cli.py:294: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], Union[Literal['rb'], Literal['br'], Literal['rbU'], Literal['rUb'], Literal['Urb'], Literal['brU'], Literal['bUr'], Literal['Ubr']], Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']]], buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> FileIO
- boostedblob/cli.py:294: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['rb+'], Literal['r+b'], Literal['+rb'], Literal['br+'], Literal['b+r'], Literal['+br'], Literal['wb+'], Literal['w+b'], Literal['+wb'], Literal['bw+'], Literal['b+w'], Literal['+bw'], Literal['ab+'], Literal['a+b'], Literal['+ab'], Literal['ba+'], Literal['b+a'], Literal['+ba'], Literal['xb+'], Literal['x+b'], Literal['+xb'], Literal['bx+'], Literal['b+x'], Literal['+bx']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedRandom
- boostedblob/cli.py:294: note:     def open(file: Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int], mode: Union[Literal['wb'], Literal['bw'], Literal['ab'], Literal['ba'], Literal['xb'], Literal['bx']], buffering: Union[Literal[-1], Literal[1]] = ..., encoding: None = ..., errors: None = ..., newline: None = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> BufferedWriter
- b```

@hauntsaninja
Copy link
Collaborator Author

Filed an issue for the regression in #12089

@hauntsaninja hauntsaninja merged commit e266cdf into python:master Jan 28, 2022
@hauntsaninja hauntsaninja deleted the sync branch January 28, 2022 08:37
afflux added a commit to afflux/pysomeip that referenced this pull request Mar 18, 2022
afflux added a commit to afflux/pysomeip that referenced this pull request Mar 23, 2022
afflux added a commit to afflux/pysomeip that referenced this pull request Mar 23, 2022
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