Replace Line namedtuple with a slotted class.
This will be useful to give Cython a way to optimise the storage in that class.
This commit is contained in:
parent
d4003d1d26
commit
41f6604ee4
1 changed files with 7 additions and 1 deletions
|
@ -28,7 +28,13 @@ allowed_color_digits = ('0', '1', '2', '3', '4', '5', '6', '7')
|
||||||
|
|
||||||
# msg is a reference to the corresponding Message tuple. text_start and
|
# msg is a reference to the corresponding Message tuple. text_start and
|
||||||
# text_end are the position delimiting the text in this line.
|
# text_end are the position delimiting the text in this line.
|
||||||
Line = collections.namedtuple('Line', 'msg start_pos end_pos prepend')
|
class Line:
|
||||||
|
__slots__ = ('msg', 'start_pos', 'end_pos', 'prepend')
|
||||||
|
def __init__(self, msg, start_pos, end_pos, prepend):
|
||||||
|
self.msg = msg
|
||||||
|
self.start_pos = start_pos
|
||||||
|
self.end_pos = end_pos
|
||||||
|
self.prepend = prepend
|
||||||
|
|
||||||
LINES_NB_LIMIT = 4096
|
LINES_NB_LIMIT = 4096
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue