Exemplo n.º 1
0
 def __init__(self, space, w_cls, bytes):
     """
     Initialize immutable bytes object and store its bytes in
     `self.immutable_bytes` slot.
     `W_BytesObject.__init__(self, space, w_class, size)` not called,
     because there is no need to `self.mutate()` and set `self.bytes`.
     """
     W_AbstractObjectWithClassReference.__init__(self, space, w_cls)
     self.immutable_bytes = bytes
Exemplo n.º 2
0
 def __init__(self, space, w_cls, words):
     """
     Initialize immutable words object and store its words in
     `self.immutable_words` slot.
     `W_Immutable_WordsObject.__init__(self, space, w_class, size)` not
     called, because there is no need to initialize `self.words`.
     """
     W_AbstractObjectWithClassReference.__init__(self, space, w_cls)
     self.immutable_words = words
Exemplo n.º 3
0
 def __init__(self, space, w_class, size):
     W_AbstractObjectWithClassReference.__init__(self, space, w_class)
     self.words = [r_uint(0)] * size
Exemplo n.º 4
0
 def __init__(self, space, w_class, size):
     W_AbstractObjectWithClassReference.__init__(self, space, w_class)
     assert isinstance(size, int)
     self.mutate()
     self.bytes = ['\x00'] * size