From 4f9b45ff4c8498b963ee2c319c8ff16dfead1629 Mon Sep 17 00:00:00 2001 From: Randolf Scholz Date: Tue, 21 Dec 2021 03:11:42 +0100 Subject: [PATCH] Logger.getChild subclass compatible typehint (#6609) Co-authored-by: Randolf Scholz Co-authored-by: Akuli Co-authored-by: Alex Waygood --- stdlib/logging/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index 70d6a1fda..2af80d645 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -1,6 +1,6 @@ import sys import threading -from _typeshed import StrPath, SupportsWrite +from _typeshed import Self, StrPath, SupportsWrite from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence from io import TextIOWrapper from string import Template @@ -59,7 +59,7 @@ class Logger(Filterer): def setLevel(self, level: _Level) -> None: ... def isEnabledFor(self, level: int) -> bool: ... def getEffectiveLevel(self) -> int: ... - def getChild(self, suffix: str) -> Logger: ... + def getChild(self: Self, suffix: str) -> Self: ... # see python/typing#980 if sys.version_info >= (3, 8): def debug( self,