(strs)
Yield ``Requirement`` objects for each specification in `strs`

    `strs` must be a string, or a (possibly-nested) iterable thereof.
Yield ``Requirement`` objects for each specification in `strs`
Yield Requirement objects for each specification in strs
def parse_requirements(strs):
    """Yield ``Requirement`` objects for each specification in `strs`

    `strs` must be a string, or a (possibly-nested) iterable thereof.
    """
    # create a steppable iterator, so we can handle \-continuations
    lines = iter(yield_lines(strs))

    for line in lines:
        # Drop comments -- a hash without a space may be in a URL.
        if ' #' in line:
            line = line[:line.find(' #')]
        # If there is a line continuation, drop it, and append the next line.
        if line.endswith('\\'):
            line = line[:-2].strip()
            try:
                line += next(lines)
            except StopIteration:
                return
        yield Requirement(line)
def parse_requirements ( strs ) : # create a steppable iterator, so we can handle \-continuations lines = iter ( yield_lines ( strs ) ) for line in lines : # Drop comments -- a hash without a space may be in a URL. if ' #' in line : line = line [ : line . find ( ' #' ) ] # If there is a line continuation, drop it, and append the next line. if line . endswith ( '\\' ) : line = line [ : - 2 ] . strip ( ) try : line += next ( lines ) except StopIteration : return yield Requirement ( line )