mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-20 16:48:27 +08:00
Improve many __(a)exit__ annotations (#9696)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from _typeshed import Incomplete
|
||||
from types import TracebackType
|
||||
|
||||
from .models.segment import SegmentContextManager as SegmentContextManager
|
||||
from .models.subsegment import (
|
||||
@@ -11,12 +12,16 @@ from .utils import stacktrace as stacktrace
|
||||
|
||||
class AsyncSegmentContextManager(SegmentContextManager):
|
||||
async def __aenter__(self): ...
|
||||
async def __aexit__(self, exc_type, exc_val, exc_tb): ...
|
||||
async def __aexit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
class AsyncSubsegmentContextManager(SubsegmentContextManager):
|
||||
async def __call__(self, wrapped, instance, args, kwargs): ...
|
||||
async def __aenter__(self): ...
|
||||
async def __aexit__(self, exc_type, exc_val, exc_tb): ...
|
||||
async def __aexit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
class AsyncAWSXRayRecorder(AWSXRayRecorder):
|
||||
def capture_async(self, name: Incomplete | None = ...): ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from types import TracebackType
|
||||
from typing import Any
|
||||
|
||||
from ..exceptions.exceptions import SegmentNameMissingException as SegmentNameMissingException
|
||||
@@ -16,7 +17,9 @@ class SegmentContextManager:
|
||||
segment: Segment
|
||||
def __init__(self, recorder: AWSXRayRecorder, name: str | None = ..., **segment_kwargs) -> None: ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc_type, exc_val, exc_tb) -> None: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
class Segment(Entity):
|
||||
trace_id: str | None
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import time
|
||||
from _typeshed import Incomplete
|
||||
from types import TracebackType
|
||||
from typing import Any
|
||||
|
||||
from ...core import AWSXRayRecorder
|
||||
@@ -21,7 +22,9 @@ class SubsegmentContextManager:
|
||||
def __init__(self, recorder: AWSXRayRecorder, name: Incomplete | None = ..., **subsegment_kwargs) -> None: ...
|
||||
def __call__(self, wrapped, instance, args: list[Any], kwargs: dict[str, Any]): ...
|
||||
def __enter__(self) -> Subsegment: ...
|
||||
def __exit__(self, exc_type, exc_val, exc_tb) -> None: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
class Subsegment(Entity):
|
||||
parent_segment: Segment
|
||||
|
||||
Reference in New Issue
Block a user