import typing
import types


def flatten(input) -> typing.List:
	"""Return the input flattened to an array.
	
	input: any variable composed of lists/generators/tuples, strings, lambda functions or other 
	objects, nested arbitrarily.
	
	Empty strings and None items are removed. 
	
	Returns a list of strings or other objects depth 1. 

	>>> flatten('hi')
	['hi']
	>>> flatten(['hi', 'ho', 'hum'])
	['hi', 'ho', 'hum']
	>>> flatten(['hi', ['ho', ['hum'] ] ])
	['hi', 'ho', 'hum']
	>>> flatten(['hi', ('ho', ('hum') ) ])
	['hi', 'ho', 'hum']
	>>> flatten(3)
	[3]
	>>> flatten( (x + 1) for x in [1,2,3])
	[2, 3, 4]
	>>> flatten(lambda: '3')
	['3']
	>>> flatten(['hi', lambda: 'ho', 'hum'])
	['hi', 'ho', 'hum']
	>>> flatten(None)
	[]
	"""
	if not input: return []
	if isinstance(input, (list, tuple, set, types.GeneratorType)):
		rv = []
		for l in input:
			rv = rv + flatten(l)
		return rv
	elif hasattr(input, 'resolveToString'): # Composeable, etc - delayed
		return [input]
	elif hasattr(input, '__call__'): # a zero-arg lambda
		return flatten(input())
	else:
		return [input]