Skip to content

Commit fe69ffc

Browse files
authored
Add a few missing stdlib modules (python#4550)
1 parent 4e88557 commit fe69ffc

7 files changed

Lines changed: 58 additions & 0 deletions

File tree

stdlib/2and3/_typeshed/xml.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Stub-only types. This module does not exist at runtime.
2+
3+
from typing import Any, Optional
4+
from typing_extensions import Protocol
5+
6+
# As defined https://docs.python.org/3/library/xml.dom.html#domimplementation-objects
7+
class DOMImplementation(Protocol):
8+
def hasFeature(self, feature: str, version: Optional[str]) -> bool: ...
9+
def createDocument(self, namespaceUri: str, qualifiedName: str, doctype: Optional[Any]) -> Any: ...
10+
def createDocumentType(self, qualifiedName: str, publicId: str, systemId: str) -> Any: ...
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from distutils.cmd import Command
2+
from typing import ClassVar, List, Optional, Tuple
3+
4+
class install_egg_info(Command):
5+
description: ClassVar[str]
6+
user_options: ClassVar[List[Tuple[str, Optional[str], str]]]
7+
def initialize_options(self) -> None: ...
8+
def finalize_options(self) -> None: ...
9+
def run(self) -> None: ...
10+
def get_outputs(self) -> List[str]: ...
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from distutils.config import PyPIRCCommand
2+
from typing import ClassVar, List, Optional, Tuple
3+
4+
class upload(PyPIRCCommand):
5+
description: ClassVar[str]
6+
boolean_options: ClassVar[List[str]]
7+
def run(self) -> None: ...
8+
def upload_file(self, command, pyversion, filename) -> None: ...

stdlib/2and3/distutils/config.pyi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from abc import abstractmethod
2+
from distutils.cmd import Command
3+
from typing import ClassVar, List, Optional, Tuple
4+
5+
DEFAULT_PYPIRC: str
6+
7+
class PyPIRCCommand(Command):
8+
DEFAULT_REPOSITORY: ClassVar[str]
9+
DEFAULT_REALM: ClassVar[str]
10+
repository: None
11+
realm: None
12+
user_options: ClassVar[List[Tuple[str, Optional[str], str]]]
13+
boolean_options: ClassVar[List[str]]
14+
def initialize_options(self) -> None: ...
15+
def finalize_options(self) -> None: ...
16+
@abstractmethod
17+
def run(self) -> None: ...

stdlib/2and3/xml/dom/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import Any
22

3+
from .domreg import getDOMImplementation as getDOMImplementation, registerDOMImplementation as registerDOMImplementation
4+
35
class Node:
46
ELEMENT_NODE: int
57
ATTRIBUTE_NODE: int

stdlib/2and3/xml/dom/domreg.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from _typeshed.xml import DOMImplementation
2+
from typing import Any, Callable, Dict, Iterable, Optional, Tuple, Union
3+
4+
well_known_implementations: Dict[str, str]
5+
registered: Dict[str, Callable[[], DOMImplementation]]
6+
7+
def registerDOMImplementation(name: str, factory: Callable[[], DOMImplementation]) -> None: ...
8+
def getDOMImplementation(
9+
name: Optional[str] = ..., features: Union[str, Iterable[Tuple[str, Optional[str]]]] = ...
10+
) -> DOMImplementation: ...

stdlib/3/json/tool.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
def main() -> None: ...

0 commit comments

Comments
 (0)