New submission from STINNER Victor: Oh oh, it looks like the implementation of tailmatch() was not finished:
/* If both are of the same kind, memcmp is sufficient */ if (kind_self == kind_sub) { return ...; } /* otherwise we have to compare each character by first accesing it */ else { /* We do not need to compare 0 and len(substring)-1 because the if statement above ensured already that they are equal when we end up here. */ /* TODO: honor direction and do a forward or backwards search */ for (i = 1; i < end_sub; ++i) { if (PyUnicode_READ(kind_self, data_self, offset + i) != PyUnicode_READ(kind_sub, data_sub, i)) return 0; } return 1; } ---------- messages: 173301 nosy: haypo, loewis, serhiy.storchaka priority: normal severity: normal status: open title: TODO in tailmatch(): it does not support backward in all cases versions: Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16281> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com