This commit is contained in:
Christian Mantha
2026-03-02 19:10:52 -05:00
commit 2ca0b9ef7c
28907 changed files with 5233713 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
from collections.abc import Iterable
def str_coercible(cls):
def __str__(self):
return self.__unicode__()
cls.__str__ = __str__
return cls
def is_sequence(value):
return isinstance(value, Iterable) and not isinstance(value, str)
def starts_with(iterable, prefix):
"""
Returns whether or not given iterable starts with given prefix.
"""
return list(iterable)[0 : len(prefix)] == list(prefix)