Lines Matching defs:annotation
1414 if param.annotation is not param.empty:
1415 annotations[name] = param.annotation
1441 def formatannotation(annotation, base_module=None):
1442 if getattr(annotation, '__module__', None) == 'typing':
1446 return re.sub(r'[\w\.]+', repl, repr(annotation))
1447 if isinstance(annotation, types.GenericAlias):
1448 return str(annotation)
1449 if isinstance(annotation, type):
1450 if annotation.__module__ in ('builtins', base_module):
1451 return annotation.__qualname__
1452 return annotation.__module__+'.'+annotation.__qualname__
1453 return repr(annotation)
1457 def _formatannotation(annotation):
1458 return formatannotation(annotation, module)
2209 if node.annotation is not None:
2267 parameters.append(Parameter(name, kind, default=default, annotation=empty))
2377 annotation = annotations.get(name, _empty)
2378 parameters.append(Parameter(name, annotation=annotation,
2386 annotation = annotations.get(name, _empty)
2387 parameters.append(Parameter(name, annotation=annotation,
2396 annotation = annotations.get(name, _empty)
2397 parameters.append(Parameter(name, annotation=annotation,
2406 annotation = annotations.get(name, _empty)
2407 parameters.append(Parameter(name, annotation=annotation,
2417 annotation = annotations.get(name, _empty)
2418 parameters.append(Parameter(name, annotation=annotation,
2665 * annotation
2666 The annotation for the parameter if specified. If the
2667 parameter has no annotation, this attribute is set to
2686 def __init__(self, name, kind, *, default=_empty, annotation=_empty):
2697 self._annotation = annotation
2748 def annotation(self):
2756 annotation=_void, default=_void):
2765 if annotation is _void:
2766 annotation = self._annotation
2771 return type(self)(name, kind, default=default, annotation=annotation)
2777 # Add annotation and default value
2799 return hash((self.name, self.kind, self.annotation, self.default))
2954 The annotation for the return type of the function if specified.
2955 If the function has no annotation for its return type, this