You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
367 B
19 lines
367 B
def qualname(cls):
|
|
"""
|
|
Returns a fully qualified name of the class, to avoid name collisions.
|
|
"""
|
|
return ".".join([cls.__module__, cls.__name__])
|
|
|
|
|
|
def _is_string(obj):
|
|
return isinstance(obj, str)
|
|
|
|
|
|
def ensure_iterable(obj):
|
|
if _is_string(obj):
|
|
return [obj]
|
|
try:
|
|
return iter(obj)
|
|
except TypeError:
|
|
return [obj]
|