mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 04:04:25 +08:00
optparse: option_class is Type[Option] (#4338)
It's a `class`, not an `instance`. <https://docs.python.org/2.7/library/optparse.html#optparse.OptionParser>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Generated by pytype, with only minor tweaks. Might be incomplete.
|
||||
import sys
|
||||
from typing import IO, Any, AnyStr, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union, overload
|
||||
from typing import IO, Any, AnyStr, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Type, Union, overload
|
||||
|
||||
# See https://groups.google.com/forum/#!topic/python-ideas/gA1gdj3RZ5g
|
||||
if sys.version_info >= (3,):
|
||||
@@ -125,8 +125,8 @@ class OptionContainer:
|
||||
conflict_handler: _Text
|
||||
defaults: Dict[_Text, Any]
|
||||
description: Any
|
||||
option_class: Any
|
||||
def __init__(self, option_class: Option, conflict_handler: Any, description: Any) -> None: ...
|
||||
option_class: Type[Option]
|
||||
def __init__(self, option_class: Type[Option], conflict_handler: Any, description: Any) -> None: ...
|
||||
def _check_conflict(self, option: Any) -> None: ...
|
||||
def _create_option_mappings(self) -> None: ...
|
||||
def _share_option_mappings(self, parser: OptionParser) -> None: ...
|
||||
@@ -183,7 +183,7 @@ class OptionParser(OptionContainer):
|
||||
self,
|
||||
usage: Optional[_Text] = ...,
|
||||
option_list: Iterable[Option] = ...,
|
||||
option_class: Option = ...,
|
||||
option_class: Type[Option] = ...,
|
||||
version: Optional[_Text] = ...,
|
||||
conflict_handler: _Text = ...,
|
||||
description: Optional[_Text] = ...,
|
||||
|
||||
Reference in New Issue
Block a user