Skip to content

Commit

Permalink
py312: Filter(er) might return a LogRecord (#10540)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
kasium and AlexWaygood authored Aug 7, 2023
1 parent c326f25 commit ab22048
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions stdlib/logging/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ class Filterer:
filters: list[_FilterType]
def addFilter(self, filter: _FilterType) -> None: ...
def removeFilter(self, filter: _FilterType) -> None: ...
def filter(self, record: LogRecord) -> bool: ...
if sys.version_info >= (3, 12):
def filter(self, record: LogRecord) -> bool | LogRecord: ...
else:
def filter(self, record: LogRecord) -> bool: ...

class Manager: # undocumented
root: RootLogger
Expand Down Expand Up @@ -378,7 +381,10 @@ class Filter:
name: str # undocumented
nlen: int # undocumented
def __init__(self, name: str = "") -> None: ...
def filter(self, record: LogRecord) -> bool: ...
if sys.version_info >= (3, 12):
def filter(self, record: LogRecord) -> bool | LogRecord: ...
else:
def filter(self, record: LogRecord) -> bool: ...

class LogRecord:
# args can be set to None by logging.handlers.QueueHandler
Expand Down

0 comments on commit ab22048

Please sign in to comment.