Exemple #1
0
 def get_type(self, i: int, type_comments: Sequence[Optional[str]],
              converter: TypeConverter) -> Optional[Type]:
     if i < len(type_comments):
         comment = type_comments[i]
         if comment is not None:
             return converter.visit_raw_str(comment)
     return None
Exemple #2
0
 def get_type(self, i: int, type_comments: Sequence[Optional[str]],
              converter: TypeConverter) -> Optional[Type]:
     if i < len(type_comments):
         comment = type_comments[i]
         if comment is not None:
             return converter.visit_raw_str(comment)
     return None
Exemple #3
0
 def get_type(self, i: int, type_comments: Sequence[Optional[str]],
              converter: TypeConverter) -> Optional[Type]:
     if i < len(type_comments):
         comment = type_comments[i]
         if comment is not None:
             typ = converter.visit_raw_str(comment)
             extra_ignore = TYPE_IGNORE_PATTERN.match(comment)
             if extra_ignore:
                 tag = cast(Any,
                            extra_ignore).group(1)  # type: Optional[str]
                 ignored = parse_type_ignore_tag(tag)
                 self.type_ignores[converter.line] = ignored
             return typ
     return None