mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
optparse.HelpFormatter: format_heading and format_usage are abstract methods (#7194)
The [docstrings state](0ae4019179/Lib/optparse.py (L255-L259)) "Subclasses must implement", and the [docs for optparse](https://docs.python.org/3/library/optparse.html) explicitly state that `TitledHelpFormatter` and `IndentedHelpFormatter` are provided as "concrete implementations" of `optparse.HelpFormatter`.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from abc import abstractmethod
|
||||
from typing import IO, Any, AnyStr, Callable, Iterable, Mapping, Sequence, overload
|
||||
|
||||
NO_DEFAULT: tuple[str, ...]
|
||||
@@ -47,9 +48,11 @@ class HelpFormatter:
|
||||
def expand_default(self, option: Option) -> str: ...
|
||||
def format_description(self, description: str) -> str: ...
|
||||
def format_epilog(self, epilog: str) -> str: ...
|
||||
@abstractmethod
|
||||
def format_heading(self, heading: Any) -> str: ...
|
||||
def format_option(self, option: Option) -> str: ...
|
||||
def format_option_strings(self, option: Option) -> str: ...
|
||||
@abstractmethod
|
||||
def format_usage(self, usage: Any) -> str: ...
|
||||
def indent(self) -> None: ...
|
||||
def set_long_opt_delimiter(self, delim: str) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user