@@ -37,6 +37,7 @@ def attrinfo(basename, base, attrname):
3737
3838endpython
3939"""
40+ from __future__ import annotations
4041
4142
4243class VimErrorMock (Exception ):
@@ -61,7 +62,7 @@ class BufferMock(ub.NiceRepr):
6162 'range', 'valid', 'vars']
6263 """
6364 def __init__ (self , text = None ):
64- self ._lines = None
65+ self ._lines : list [ str ] | None = None
6566 self .name = ''
6667
6768 self .number = 1
@@ -102,29 +103,29 @@ def mark(self, key):
102103
103104 @property
104105 def _text (self ):
105- return '\n ' .join (self ._lines )
106+ return '\n ' .join (self ._lines ) # type: ignore
106107
107108 def __delitem__ (self , key ):
108- del self ._lines [key ]
109+ del self ._lines [key ] # type: ignore
109110
110111 def __getitem__ (self , key ):
111112 # Note indexing into a buffer is zero indexed like normal
112113 # However remember reported cursor positions are 1 indexed
113114 if isinstance (key , slice ):
114- return self ._lines [key .start : key .stop : key .step ]
115+ return self ._lines [key .start : key .stop : key .step ] # type: ignore
115116 if not isinstance (key , int ):
116117 raise TypeError ("Index should be integer, not %s" % classname (key ))
117- return self ._lines [key ]
118+ return self ._lines [key ] # type: ignore
118119
119120 def __setitem__ (self , key , value ):
120121 if isinstance (key , slice ):
121- self ._lines [key .start : key .stop : key .step ] = value
122+ self ._lines [key .start : key .stop : key .step ] = value # type: ignore
122123 elif not isinstance (key , int ):
123124 raise TypeError ("Indes should be integer, not %s" % classname (key ))
124- self ._lines [key ] = value
125+ self ._lines [key ] = value # type: ignore
125126
126127 def __len__ (self ):
127- return len (self ._lines )
128+ return len (self ._lines ) # type: ignore
128129
129130 def setup_text (self , text = None , name = '' ):
130131 text = text or ''
0 commit comments