
Oct. 22, 2023
7:23 a.m.
On Mon, 23 Oct 2023 at 01:14, Juancarlo Añez <apalala@gmail.com> wrote:
The re module is a black swan, because most of stdlib raises exceptions on invalid arguments or not being able to deliver.
This is a comparison function, and like every other comparison function, it signals its results with a return value. It returns a truthy value if the regular expression matches, and a falsy value if it does not. As such, it is perfectly in line with fnmatch.fnmatch(), all of the str.is*() methods, math.isclose(), and pretty much everything else. So I guess by your logic, Python's standard library must have come from Perth, as it is nothing but black swans. ChrisA