-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #836 from michi42/master
Add type stubs for JPype internal customizers
- Loading branch information
Showing
5 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class _JRuntime: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
from typing import Iterable, Collection, List, Set, Mapping, Tuple, TypeVar, Iterator, Generator, Union, overload | ||
|
||
E = TypeVar('E') | ||
K = TypeVar('K') | ||
V = TypeVar('V') | ||
|
||
|
||
class _JIterable(Iterable[E]): | ||
def __iter__(self) -> Iterator[E]: ... | ||
|
||
|
||
class _JCollection(Collection[E]): | ||
def __len__(self) -> int: ... | ||
|
||
def __delitem__(self, i: E) -> None: ... | ||
|
||
def __contains__(self, i: E) -> bool: ... | ||
|
||
|
||
class _JList(List[E]): | ||
@overload | ||
def __getitem__(self, ndx: int) -> E: ... | ||
|
||
@overload | ||
def __getitem__(self, ndx: slice) -> E: ... | ||
|
||
def __setitem__(self, ndx: int, v: E) -> None: ... | ||
|
||
def __delitem__(self, ndx: int) -> E: ... | ||
|
||
def __reversed__(self) -> Generator[E, None, None]: ... | ||
|
||
def index(self, obj: E) -> int: ... | ||
|
||
def count(self, obj: E) -> int: ... | ||
|
||
def insert(self, idx: int, obj: E) -> '_JList'[E]: ... | ||
|
||
def append(self, obj: E) -> '_JList'[E]: ... | ||
|
||
def reverse(self) -> None: ... | ||
|
||
def extend(self, lst: Iterable[E]) -> None: ... | ||
|
||
def pop(self, idx: int = ...) -> E: ... | ||
|
||
def __iadd__(self, obj: List[E]) -> '_JList'[E]: ... | ||
|
||
def __add__(self, obj: List[E]) -> '_JList'[E]: ... | ||
|
||
def remove(self, obj: E) -> None: ... | ||
|
||
|
||
class _JMap(Mapping[K, V]): | ||
def __len__(self) -> int: ... | ||
|
||
def __iter__(self) -> Iterator[K]: ... | ||
|
||
def __delitem__(self, i: K) -> V: ... | ||
|
||
def __getitem__(self, ndx: K) -> V: ... | ||
|
||
def __setitem__(self, ndx: K, v: V) -> None: ... | ||
|
||
def items(self) -> Set['_JMapEntry'[K, V]]: ... | ||
|
||
def keys(self) -> Set[K]: ... | ||
|
||
def __contains__(self, item: V) -> bool: ... | ||
|
||
|
||
class _JSet(Set[E]): | ||
def __delitem__(self, i: E): ... | ||
|
||
|
||
class _JMapEntry(Tuple[K, V]): | ||
def __len__(self) -> int: ... | ||
|
||
def __getitem__(self, x: int) -> Union[K, V]: ... | ||
|
||
|
||
class _JIterator(Iterator[E]): | ||
def __next__(self) -> E: ... | ||
|
||
def __iter__(self) -> Iterator[E]: ... | ||
|
||
|
||
class _JEnumeration(Iterator[E]): | ||
def __next__(self) -> E: ... | ||
|
||
def __iter__(self) -> Iterator[E]: ... | ||
|
||
def next(self) -> E: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from types import TracebackType | ||
from typing import ContextManager, Optional, Type | ||
|
||
|
||
class _JCloseable(ContextManager['_JCloseable']): | ||
def __enter__(self) -> '_JCloseable': ... | ||
|
||
def __exit__(self, exception_type: Optional[Type[BaseException]], exception_value: Optional[BaseException], | ||
traceback: Optional[TracebackType]) -> bool: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from typing import Any, Text | ||
|
||
|
||
class _JStringProto(Text): | ||
def __add__(self, other: Text) -> Text: ... | ||
|
||
def __len__(self) -> int: ... | ||
|
||
def __getitem__(self, i: int) -> Text: ... | ||
|
||
def __contains__(self, other: Text) -> bool: ... | ||
|
||
def __hash__(self) -> Any: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class _JThread: | ||
@staticmethod | ||
def isAttached() -> bool: ... | ||
|
||
@staticmethod | ||
def attach() -> None: ... | ||
|
||
@staticmethod | ||
def attachAsDaemon() -> None: ... | ||
|
||
@staticmethod | ||
def detach() -> None: ... |