def split_namespace(ident):
    """
    Splits an identifier into its namespace and its bare identifier.

    >>> split_namespace('foo')
    (None, 'foo')
    >>> split_namespace('foo:bar')
    ('foo', 'bar')
    """
    if ':' not in ident:
        return (None, ident)
    else:
        result = ident.split(':', 1)
        if len(result) == 1:
            return ('', ident)
        else:
            return tuple(result)