是否有可能在Python中定义递归列表理解?
可能是一个简单的例子,但有些东西:
nums = [1, 1, 2, 2, 3, 3, 4, 4] willThisWork = [x for x in nums if x not in self] # self being the current comprehension
有可能这样吗?
python list-comprehension
list-comprehension ×1
python ×1