División de archivos de texto en secciones con una línea especial delimitador - python

Tengo un archivo de entrada como tal:

This is a text block start
This is the end

And this is another
with more than one line
and another line.

La tarea deseada es leer los archivos por sección delimitada por una línea especial, en este caso es una línea vacía, p. [fuera]:

[['This is a text block start', 'This is the end'],
['And this is another','with more than one line', 'and another line.']]

He estado obteniendo el resultado deseado al hacerlo:

def per_section(it):
    """ Read a file and yield sections using empty line as delimiter """
    section = []
    for line in it:
        if line.strip('\n'):
            section.append(line)
        else:
            yield ''.join(section)
            section = []
    # yield any remaining lines as a section too
    if section:
        yield ''.join(section)

Pero si la línea especial es una línea que comienza con# p.ej.:

# Some comments, maybe the title of the following section
This is a text block start
This is the end
# Some other comments and also the title
And this is another
with more than one line
and another line.

Tengo que hacer esto:

def per_section(it):
    """ Read a file and yield sections using empty line as delimiter """
    section = []
    for line in it:
        if line[0] != "#":
            section.append(line)
        else:
            yield ''.join(section)
            section = []
    # yield any remaining lines as a section too
    if section:
        yield ''.join(section)

Si tuviera que permitir elper_section() para tener un parámetro delimitador, podría intentar esto:

def per_section(it, delimiter== '\n'):
    """ Read a file and yield sections using empty line as delimiter """
    section = []
    for line in it:
        if line.strip('\n') and delimiter == '\n':
            section.append(line)
        elif delimiter= '\#' and line[0] != "#":
            section.append(line)
        else:
            yield ''.join(section)
            section = []
    # yield any remaining lines as a section too
    if section:
        yield ''.join(section)

Pero, ¿hay alguna manera de no codificar todos los delimitadores posibles?

Respuestas a la pregunta(3)

Su respuesta a la pregunta