New submission from Riccardo Coccioli <rcocci...@gmail.com>:
The documentation for the logging.Filter().filter() method states: #----- Is the specified record to be logged? Returns 0 for no, nonzero for yes. If deemed appropriate, the record may be modified in-place. #----- While its implementation returns a boolean in Lib/logging/__init__.py. Moreover the most recent version of mypy (0.790) reports it as an error if a custom class inherit from logging.Filter and implement a filter() method that returns an int as specified in the documentation: #----- error: Return type "int" of "filter" incompatible with return type "bool" in supertype "Filter" [override] #----- P.S. As a side note, the API for filter() is quite counter-intuitive as it requires the filter() method to return False to filter out the record and True to include it. ---------- assignee: docs@python components: Documentation messages: 378480 nosy: Riccardo Coccioli, docs@python priority: normal severity: normal status: open title: Documentation for logging.Filter.filter reports the wrong return type type: behavior versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42011> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com