pythonoptparsepyi

Why there spread operator (...) is use in the .pyi file in the function definition?


I often encounter spread (...) in the source code of many programs. I google about it but I did not find any relevant answer. I am wondering why spread operator are use in the file. Here is the example.

class HelpFormatter:
    def __init__(self, indent_increment: int, max_help_position: int, width: Optional[int], short_first: int) -> None: ...
    def _format__Text(self, _Text: _Text) -> _Text: ...
    def dedent(self) -> None: ...
    def expand_default(self, option: Option) -> _Text: ...
    def format_description(self, description: _Text) -> _Text: ...
    def format_epilog(self, epilog: _Text) -> _Text: ...
    def format_heading(self, heading: Any) -> _Text: ...
    def format_option(self, option: OptionParser) -> _Text: ...
    def format_option_strings(self, option: OptionParser) -> Any: ...
    def format_usage(self, usage: Any) -> _Text: ...
    def indent(self) -> None: ...
    def set_long_opt_delimiter(self, delim: _Text) -> None: ...
    def set_parser(self, parser: OptionParser) -> None: ...
    def set_short_opt_delimiter(self, delim: _Text) -> None: ...
    def store_option_strings(self, parser: OptionParser) -> None: ...

What is the purpose of pyi file and why spread operator is used?

Here is image how code look like enter image description here


Solution

  • I think, it's kinda "interface" realization. It's equal to:

    def func():
        pass