aboutsummaryrefslogtreecommitdiffstats
path: root/env/lib/python3.10/site-packages/setuptools/_itertools.py
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-11-14 16:43:12 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-11-14 16:43:12 +0530
commitd47f8b48935d258f4c5c3e2267911753bebd5214 (patch)
tree3ed04e75bc3fc7c8e4ce618f527565da1df630a1 /env/lib/python3.10/site-packages/setuptools/_itertools.py
parent9468226a9e2e2ab8cdd599f1d8538e860ca86120 (diff)
downloadidcard-d47f8b48935d258f4c5c3e2267911753bebd5214.tar.gz
idcard-d47f8b48935d258f4c5c3e2267911753bebd5214.tar.bz2
idcard-d47f8b48935d258f4c5c3e2267911753bebd5214.zip
id card
Diffstat (limited to 'env/lib/python3.10/site-packages/setuptools/_itertools.py')
-rw-r--r--env/lib/python3.10/site-packages/setuptools/_itertools.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/env/lib/python3.10/site-packages/setuptools/_itertools.py b/env/lib/python3.10/site-packages/setuptools/_itertools.py
deleted file mode 100644
index b8bf6d2..0000000
--- a/env/lib/python3.10/site-packages/setuptools/_itertools.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from setuptools.extern.more_itertools import consume # noqa: F401
-
-
-# copied from jaraco.itertools 6.1
-def ensure_unique(iterable, key=lambda x: x):
- """
- Wrap an iterable to raise a ValueError if non-unique values are encountered.
-
- >>> list(ensure_unique('abc'))
- ['a', 'b', 'c']
- >>> consume(ensure_unique('abca'))
- Traceback (most recent call last):
- ...
- ValueError: Duplicate element 'a' encountered.
- """
- seen = set()
- seen_add = seen.add
- for element in iterable:
- k = key(element)
- if k in seen:
- raise ValueError(f"Duplicate element {element!r} encountered.")
- seen_add(k)
- yield element