Commits

bmearns  committed 7e0832b

Fixed up filepos, init on namedtuple doesn't work the way I thought it did. Neither does new.

  • Participants
  • Parent commits 8c8cd64

Comments (0)

Files changed (1)

File templ/filepos.py

 import collections
 
 class Filepos(collections.namedtuple("FileposTuple", "filename line offset")):
-    def __init__(self, filename, line=None, offset=None):
-        super(Filepos, self).__init__(filename, line, offset)
+    def __new__(_cls, filename, line=None, offset=None):
+        super(_cls, Filepos).__new__(_cls, filename, line, offset)
         
     def __str__(self):
         return self.toString()