File: sortedmap.pyi

package info (click to toggle)
python-atom 0.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,676 kB
  • sloc: cpp: 9,254; python: 6,181; makefile: 123
file content (32 lines) | stat: -rw-r--r-- 1,257 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# --------------------------------------------------------------------------------------
# Copyright (c) 2021-2024, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# --------------------------------------------------------------------------------------
from typing import Generic, List, Optional, Tuple, TypeVar, Union, overload

K = TypeVar("K")
V = TypeVar("V")
D = TypeVar("D")

class sortedmap(Generic[K, V]):
    @overload
    def get(self, key: K, default: None = None) -> Optional[V]: ...
    @overload
    def get(self, key: K, default: D) -> Union[V, D]: ...
    @overload
    def pop(self, key: K, default: None = None) -> V: ...
    @overload
    def pop(self, key: K, default: D) -> Union[V, D]: ...
    def clear(self) -> None: ...
    def keys(self) -> List[K]: ...
    def values(self) -> List[V]: ...
    def items(self) -> List[Tuple[K, V]]: ...
    def copy(self) -> "sortedmap[K, V]": ...
    def __contains__(self, key: K) -> bool: ...
    def __getitem__(self, key: K) -> V: ...
    def __setitem__(self, key: K, value: V) -> None: ...
    def __delitem__(self, key: K) -> None: ...
    def __sizeof__(self) -> int: ...