mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Add pathlib.Path.__enter__ and __exit__ (#2048)
This commit is contained in:
committed by
Jelle Zijlstra
parent
7cd2016931
commit
5327841a18
@@ -1,6 +1,7 @@
|
||||
# Stubs for pathlib (Python 3.4)
|
||||
|
||||
from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union, List
|
||||
from types import TracebackType
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -52,6 +53,10 @@ class PurePosixPath(PurePath): ...
|
||||
class PureWindowsPath(PurePath): ...
|
||||
|
||||
class Path(PurePath):
|
||||
def __enter__(self) -> Path: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_value: Optional[BaseException],
|
||||
traceback: Optional[TracebackType]) -> Optional[bool]: ...
|
||||
@classmethod
|
||||
def cwd(cls: Type[_P]) -> _P: ...
|
||||
def stat(self) -> os.stat_result: ...
|
||||
|
||||
Reference in New Issue
Block a user