Example #1
0
    def test_unicode(self):
        '''
        Unicode

        - Overridden attributes are treated like normal ones.
        - But other protected attributes remain protected.
        - And normal attributes behave normally.
        '''
        # Non-ascii keys and vals work fine.
        u = u'\xf8'
        sd = Superdict(a = 1, b = 2)
        sd[u] = 12
        sd.x = u
        # Non-ascii keys work fine exception messages.
        sd = StrictSuperdict('ab', a = 1, b = 2)
        with aRaz(AERR):
            sd[u] = 12