On 2023-11-13, Dom Grigonis via Python-list <python-list@python.org> wrote: > Hi All, > > I think it could be useful to have `xor` builtin, which has API similar to > the one of `any` and `all`. > > * Also, it could have optional second argument `n=1`, which > * indicates how many positives indicates `True` return. For > * complete flexibility 3rd argument could indicate if `the number` > * is equal, greater, less, ... than `n`
I would expect "xor" to return true if there are an odd number of trues, and false if there are an even number of trues. It's not clear to me what you're asking for. -- https://mail.python.org/mailman/listinfo/python-list