Skip to content

A possibly unreachable branch in royin.py #552

@veer66

Description

@veer66

In royin.py:

I suppose the last else block is unreachable since word[i] == _RO_RUA should be always true in this whole block.

elif word[i] == _RO_RUA and i + 1 < len(word):
    if word[i + 1] == _RO_RUA:
        word = list(word)
        del word[i + 1]
        if i + 2 == len_cons:
            word[i] = "an"
        else:
            word[i] = "a"
        word = "".join(word)
        i += 1
    elif word[i] == _RO_RUA:
        word = word.replace(
            consonants[i], _CONSONANTS[consonants[i]][1]
        )
        i += 1
    else:
        word = word.replace(
            consonants[i],
            _CONSONANTS[consonants[i]][1]
        )
        i += 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbugs in the library

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions