def get__all__entries(obj):
 try:
  words = getattr(obj, '__all__')
 except:
  return []
 return [cast_unicode_py2(w) for w in words if isinstance(w, str)]

def get__all__entries ( obj ) : try : words = getattr ( obj , '__all__' ) except : return [ ] return [ cast_unicode_py2 ( w ) for w in words if isinstance ( w , str ) ]
returns the strings in the __all__ attribute .