你的代码不对的
https://stackoverflow.com/questions/71181880/is-there-any-similar-collection-library-such-as-distinctby-groupby-in-python
【 在 lokta 的大作中提到: 】
: 这样的?
: list1 = [1, 2, 3, 5, 4]
: assert operator.eq(set([i % 3 for i in list1]), set([1, 2, 3]))
: ...................
--
FROM 124.65.8.*