(globals, module_name)
return [getattr(v, '__name__', k)
            for k, v in globals.items()                          # export
            if ((callable(v) and v.__module__ == module_name     # callables from this module
                 or k.isupper()) and                             # or CONSTANTS
                not getattr(v, '__name__', k).startswith('_'))]
Return list of important for export globals (callables, constants) from
    `globals` dict, defined in module `module_name`.

    Usage
    -----
    In some module, on the second-to-last line:

    __all__ = export_globals(globals(), __name__)
Return list of important for export globals (callables, constants) from
    `globals` dict, defined in module `module_name`.
Return list of important for export globals ( callables constants ) from globals dict defined in module module_name .
def export_globals(globals, module_name):
    """
    Return list of important for export globals (callables, constants) from
    `globals` dict, defined in module `module_name`.

    Usage
    -----
    In some module, on the second-to-last line:

    __all__ = export_globals(globals(), __name__)

    """
    return [getattr(v, '__name__', k)
            for k, v in globals.items()                          # export
            if ((callable(v) and v.__module__ == module_name     # callables from this module
                 or k.isupper()) and                             # or CONSTANTS
                not getattr(v, '__name__', k).startswith('_'))]
def export_globals ( globals , module_name ) : return [ getattr ( v , '__name__' , k ) for k , v in globals . items ( ) # export if ( ( callable ( v ) and v . __module__ == module_name # callables from this module or k . isupper ( ) ) and # or CONSTANTS not getattr ( v , '__name__' , k ) . startswith ( '_' ) ) ]