vscode python-language-server에서 optparse.pyi 구현 끝에 세 개의 (…) 점이 작성되는 이유는 무엇입니까? [복제]

Dec 09 2020

많은 프로그램의 소스 코드에서 종종 세 개의 점 (...)을 만납니다. 나는 그것에 대해 구글 검색했지만 관련 답변을 찾지 못했습니다. 왜 이것들이 파이썬 라이브러리 optparse의 소스 코드 구현의 끝에 있는지 궁금합니다. 다음은 라이브러리의 예제 클래스입니다.

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: ...

위 코드의 모든 메소드 끝에 ... 점이있는 이유. 그 목적은 무엇입니까?

다음은 코드가 어떻게 보이는지 이미지입니다.

답변

1 vhshunter Dec 09 2020 at 03:24

나는 일종의 "인터페이스"실현이라고 생각합니다. 다음과 같습니다.

def func():
    pass