mirror of
https://github.com/python/cpython.git
synced 2025-08-16 06:40:56 +00:00

* gh-98098: Move zipfile into a package. * Moved test_zipfile to a package * Extracted module for test_path. * Add blurb * Add jaraco as owner of zipfile.Path. * Synchronize with minor changes found at jaraco/zipp@d9e7f4352d. * gh-98108: Sync with zipp 3.9.1 adding pickleability.
12 lines
301 B
Python
12 lines
301 B
Python
# from more_itertools v8.13.0
|
|
def always_iterable(obj, base_type=(str, bytes)):
|
|
if obj is None:
|
|
return iter(())
|
|
|
|
if (base_type is not None) and isinstance(obj, base_type):
|
|
return iter((obj,))
|
|
|
|
try:
|
|
return iter(obj)
|
|
except TypeError:
|
|
return iter((obj,))
|