Exemplo n.º 1
0
def _fixup_ulcase(space):
    stringmod = space.call_function(
        space.getattr(space.getbuiltinmodule('__builtin__'),
                      space.wrap('__import__')), space.wrap('string'))
    # create uppercase map string
    ul = []
    for c in xrange(256):
        if rlocale.isupper(c):
            ul.append(chr(c))
    space.setattr(stringmod, space.wrap('uppercase'), space.wrap(''.join(ul)))

    # create lowercase string
    ul = []
    for c in xrange(256):
        if rlocale.islower(c):
            ul.append(chr(c))
    space.setattr(stringmod, space.wrap('lowercase'), space.wrap(''.join(ul)))

    # create letters string
    ul = []
    for c in xrange(256):
        if rlocale.isalpha(c):
            ul.append(chr(c))
    space.setattr(stringmod, space.wrap('letters'), space.wrap(''.join(ul)))
Exemplo n.º 2
0
def _fixup_ulcase(space):
    stringmod = space.call_function(
        space.getattr(space.getbuiltinmodule('__builtin__'),
                      space.wrap('__import__')), space.wrap('string'))
    # create uppercase map string
    ul = []
    for c in xrange(256):
        if rlocale.isupper(c):
            ul.append(chr(c))
    space.setattr(stringmod, space.wrap('uppercase'), space.wrap(''.join(ul)))

    # create lowercase string
    ul = []
    for c in xrange(256):
        if rlocale.islower(c):
            ul.append(chr(c))
    space.setattr(stringmod, space.wrap('lowercase'), space.wrap(''.join(ul)))

    # create letters string
    ul = []
    for c in xrange(256):
        if rlocale.isalpha(c):
            ul.append(chr(c))
    space.setattr(stringmod, space.wrap('letters'), space.wrap(''.join(ul)))
Exemplo n.º 3
0
 def fn():
     assert isupper(ord("A"))
     assert islower(ord("a"))
     assert not isalpha(ord(" "))
     assert isalnum(ord("1"))
     assert tolower(ord("A")) == ord("a")
Exemplo n.º 4
0
 def fn():
     assert isupper(ord("A"))
     assert islower(ord("a"))
     assert not isalpha(ord(" "))
     assert isalnum(ord("1"))
     assert tolower(ord("A")) == ord("a")
Exemplo n.º 5
0
 def test_lower_upper(self):
     assert isupper(ord("A"))
     assert islower(ord("a"))
     assert not isalpha(ord(" "))
     assert isalnum(ord("1"))
     assert tolower(ord("A")) == ord("a")