From 4383a6abfc765c7083949b03319d0f9574fdfab2 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 1 Mar 2013 22:18:50 +0100 Subject: Test to use slots instead of namedtuples --- src/windows.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/windows.py') diff --git a/src/windows.py b/src/windows.py index 2d32da30..4c8793d2 100644 --- a/src/windows.py +++ b/src/windows.py @@ -43,7 +43,14 @@ allowed_color_digits = ('0', '1', '2', '3', '4', '5', '6', '7') # msg is a reference to the corresponding Message tuple. text_start and text_end are the position # delimiting the text in this line. # first is a bool telling if this is the first line of the message. -Line = collections.namedtuple('Line', 'msg start_pos end_pos') + +class Line(object): + __slots__ = ('msg', 'start_pos', 'end_pos') + + def __init__(self, msg, start_pos, end_pos): + self.msg = msg + self.start_pos = start_pos + self.end_pos = end_pos g_lock = RLock() -- cgit v1.2.3