1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
{{#args}}{{#callable_protocol_return}}
class {{callable_type}}(typing.Protocol):
def __call__(self{{#callable_protocol_args}}, {{callable_protocol_args}}{{/callable_protocol_args}}) -> {{callable_protocol_return}}:
...
{{/callable_protocol_return}}{{/args}}
{{#documentation.short_description}}
# {{documentation.short_description}}
{{/documentation.short_description}}
def {{short_name}}({{#self}}self{{#documentation.has_args}}, {{/documentation.has_args}}{{/self}}{{documentation.args_declaration}}) -> {{documentation.return_type}}:
"""
{{#documentation.description}}
{{text}}
{{/documentation.description}}
{{#documentation.has_args}}
Args:
{{#documentation.args}}
{{name}} ({{type}}): {{text}}
{{/documentation.args}}
{{/documentation.has_args}}
{{#documentation.has_return}}
Returns:
{{documentation.return_type}}: {{documentation.return_text}}
{{/documentation.has_return}}
"""
...
|