Skip to content

Commit

Permalink
Add more missing methods to os._Environ (python#6926)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Jan 16, 2022
1 parent af8e37d commit dbcb38a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion stdlib/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ if sys.version_info >= (3, 9):
path = _path

_T = TypeVar("_T")
_T1 = TypeVar("_T1")
_T2 = TypeVar("_T2")
_AnyStr_co = TypeVar("_AnyStr_co", str, bytes, covariant=True)

# ----- os variables -----
Expand Down Expand Up @@ -246,9 +248,12 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]):
def __iter__(self) -> Iterator[AnyStr]: ...
def __len__(self) -> int: ...
if sys.version_info >= (3, 9):
def __or__(self, value: Mapping[_T1, _T2]) -> dict[AnyStr | _T1, AnyStr | _T2]: ...
def __ror__(self, value: Mapping[_T1, _T2]) -> dict[AnyStr | _T1, AnyStr | _T2]: ...
# We use @overload instead of a Union for reasons similar to those given for
# overloading MutableMapping.update in stdlib/typing.pyi
@overload
# The type: ignore is needed due to incompatible __or__/__ior__ signatures
@overload # type: ignore[misc]
def __ior__(self: Self, value: Mapping[AnyStr, AnyStr]) -> Self: ...
@overload
def __ior__(self: Self, value: Iterable[tuple[AnyStr, AnyStr]]) -> Self: ...
Expand Down

0 comments on commit dbcb38a

Please sign in to comment.