mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 08:47:39 +08:00
Fix Pathlib.from_uri return-type (#12276)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path, PureWindowsPath
|
||||
from typing_extensions import assert_type
|
||||
|
||||
if Path("asdf") == Path("asdf"):
|
||||
...
|
||||
@@ -18,3 +20,11 @@ if Path("asdf") == "asdf": # type: ignore
|
||||
# where they can never hold true.
|
||||
if PureWindowsPath("asdf") == Path("asdf"): # type: ignore
|
||||
...
|
||||
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
|
||||
class MyCustomPath(Path): ...
|
||||
|
||||
pth = MyCustomPath.from_uri("file:///tmp/abc.txt")
|
||||
assert_type(pth, MyCustomPath)
|
||||
|
||||
Reference in New Issue
Block a user