Skip to content

Add a few missing stdlib modules #4550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions stdlib/2and3/_typeshed/xml.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Stub-only types. This module does not exist at runtime.

from typing import Any, Optional
from typing_extensions import Protocol

# As defined https://docs.python.org/3/library/xml.dom.html#domimplementation-objects
class DOMImplementation(Protocol):
def hasFeature(self, feature: str, version: Optional[str]) -> bool: ...
def createDocument(self, namespaceUri: str, qualifiedName: str, doctype: Optional[Any]) -> Any: ...
def createDocumentType(self, qualifiedName: str, publicId: str, systemId: str) -> Any: ...
10 changes: 10 additions & 0 deletions stdlib/2and3/distutils/command/install_egg_info.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from distutils.cmd import Command
from typing import ClassVar, List, Optional, Tuple

class install_egg_info(Command):
description: ClassVar[str]
user_options: ClassVar[List[Tuple[str, Optional[str], str]]]
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_outputs(self) -> List[str]: ...
8 changes: 8 additions & 0 deletions stdlib/2and3/distutils/command/upload.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from distutils.config import PyPIRCCommand
from typing import ClassVar, List, Optional, Tuple

class upload(PyPIRCCommand):
description: ClassVar[str]
boolean_options: ClassVar[List[str]]
def run(self) -> None: ...
def upload_file(self, command, pyversion, filename) -> None: ...
17 changes: 17 additions & 0 deletions stdlib/2and3/distutils/config.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from abc import abstractmethod
from distutils.cmd import Command
from typing import ClassVar, List, Optional, Tuple

DEFAULT_PYPIRC: str

class PyPIRCCommand(Command):
DEFAULT_REPOSITORY: ClassVar[str]
DEFAULT_REALM: ClassVar[str]
repository: None
realm: None
user_options: ClassVar[List[Tuple[str, Optional[str], str]]]
boolean_options: ClassVar[List[str]]
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
@abstractmethod
def run(self) -> None: ...
2 changes: 2 additions & 0 deletions stdlib/2and3/xml/dom/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Any

from .domreg import getDOMImplementation as getDOMImplementation, registerDOMImplementation as registerDOMImplementation

class Node:
ELEMENT_NODE: int
ATTRIBUTE_NODE: int
Expand Down
10 changes: 10 additions & 0 deletions stdlib/2and3/xml/dom/domreg.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from _typeshed.xml import DOMImplementation
from typing import Any, Callable, Dict, Iterable, Optional, Tuple, Union

well_known_implementations: Dict[str, str]
registered: Dict[str, Callable[[], DOMImplementation]]

def registerDOMImplementation(name: str, factory: Callable[[], DOMImplementation]) -> None: ...
def getDOMImplementation(
name: Optional[str] = ..., features: Union[str, Iterable[Tuple[str, Optional[str]]]] = ...
) -> DOMImplementation: ...
1 change: 1 addition & 0 deletions stdlib/3/json/tool.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
def main() -> None: ...