'True if this namespace has no children in the trie.'

def is_leaf(self, namespace):

    (first, sep, rest) = namespace.partition(self._sep)
    if (not first):
        return bool(self._subspaces)
    elif (first not in self._subspaces):
        return False
    else:
        return self._subspaces[first].is_leaf(rest)
