[issue35899] '_is_sunder' function in 'enum' module fails on empty string

Maxwell report at bugs.python.org
Tue Feb 5 09:32:26 EST 2019


Maxwell <maxwellpxt at gmail.com> added the comment:

Typo fix on solution 2:

def _is_sunder(name):
    """Returns True if a _sunder_ name, False otherwise."""
    return (name[:1] == name[-1:] == '_' and
            name[1:2] != '_' and
            name[-2:-1] != '_' and
            len(name) > 2)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35899>
_______________________________________


More information about the Python-bugs-list mailing list