# coding=utf-8 import re c = u'İ' assert len(c) == 1 # This fails on Python 2.7.13, which loses the required combining character. assert c.lower() != 'i' assert len(c.lower()) == 2 pattern = re.compile(c, re.IGNORECASE) assert pattern.match(c) assert u'i' != c.lower() assert u'I' != c # This fails on Python 3.6.1 - despite c.lower() correctly being a two # codepoint string, the combining character seems to be lost in the match. assert not pattern.match('i')