@@ -148,14 +148,14 @@ def validate(self) -> None:
148148 _ = self .libzim_value
149149
150150 @abstractmethod
151- def get_cleaned_value (self , value : Any ) -> T : ... # pragma: no cover
151+ def get_cleaned_value (self , value : Any ) -> T : ...
152152
153153 @property
154154 def libzim_value (self ) -> bytes :
155155 return self .get_libzim_value ()
156156
157157 @abstractmethod
158- def get_libzim_value (self ) -> bytes : ... # pragma: no cover
158+ def get_libzim_value (self ) -> bytes : ...
159159
160160
161161# Alias for convenience when function accept any metadata
@@ -236,12 +236,12 @@ def get_binary_from(
236236 elif isinstance (value , bytes ):
237237 bvalue = value
238238 else :
239- last_pos : int
239+ last_pos : int = 0
240240 if isinstance (value , SupportsSeekableRead ) and value .seekable ():
241241 last_pos = value .tell ()
242242 bvalue = value .read ()
243243 if isinstance (value , SupportsSeekableRead ) and value .seekable ():
244- value .seek (last_pos ) # pyright: ignore[reportPossiblyUnboundVariable]
244+ value .seek (last_pos )
245245 if not self .empty_allowed and not value :
246246 raise ValueError ("Missing value (empty not allowed)" )
247247 return bvalue
@@ -495,8 +495,8 @@ def get_reserved_names(cls) -> list[str]:
495495 for field in fields (cls ):
496496 if not isinstance (field .type , type ):
497497 continue
498- # if field type is a type, it means that it is required (otherwise field
499- # type is a string when None is allowed)
498+ # field. type is a ` type` only when expecting a single type
499+ # and is a string in case of None Union
500500 names .append (getattr (field .type , "meta_name" , "" ))
501501 return names
502502
0 commit comments