actually never implemented a simple list intersection?

This commit is contained in:
Stefan Harmuth 2022-12-03 06:23:12 +01:00
parent 4f45d1f32d
commit b497ee4bc5

View File

@ -3,7 +3,7 @@ import inspect
import os.path import os.path
import sys import sys
from functools import wraps from functools import wraps
from typing import Any, Union from typing import Any, Union, List
def get_script_dir(follow_symlinks: bool = True) -> str: def get_script_dir(follow_symlinks: bool = True) -> str:
@ -76,3 +76,11 @@ def cache(func):
return result return result
return newfunc return newfunc
def list_intersection(*args) -> list:
ret = set(args[0])
for l in args[1:]:
ret = ret.intersection(l)
return list(ret)