tbapi.api.indexed_dictionary

 1from __future__ import annotations
 2from typing import TYPE_CHECKING
 3from tbapi.common.decorators import tb_class, tb_interface
 4from tbapi.common.converters import to_python_datetime, to_net_datetime
 5from datetime import datetime
 6from Tickblaze.Scripts.Api import IndexedDictionary as _IndexedDictionary
 7from typing import Any, overload
 8from abc import ABC, abstractmethod
 9
10@tb_class(_IndexedDictionary)
11class IndexedDictionary():
12    """A dictionary with an indexer that allows accessing elements by their index in addition to the key.            The type of the key in the dictionary.      The type of the value in the dictionary."""
13
14    @overload
15    @staticmethod
16    def new() -> "IndexedDictionary":
17        """Constructor overload with arguments: """
18        ...
19    @staticmethod
20    def new(*args, **kwargs):
21        """Generic factory method for IndexedDictionary. Use overloads for IDE type hints."""
22        return IndexedDictionary(*args, **kwargs)
23
24
25
26
27    def __getitem__(self, index: int) -> Any:
28        result = self._value[index]
29        return result
30
31    def __setitem__(self, index: int, value: Any):
32        tmp = value
33        self._value[index] = tmp
@tb_class(_IndexedDictionary)
class IndexedDictionary:
18@tb_class(_IndexedDictionary)
19class IndexedDictionary():
20    """A dictionary with an indexer that allows accessing elements by their index in addition to the key.            The type of the key in the dictionary.      The type of the value in the dictionary."""
21
22    @overload
23    @staticmethod
24    def new() -> "IndexedDictionary":
25        """Constructor overload with arguments: """
26        ...
27    @staticmethod
28    def new(*args, **kwargs):
29        """Generic factory method for IndexedDictionary. Use overloads for IDE type hints."""
30        return IndexedDictionary(*args, **kwargs)
31
32
33
34
35    def __getitem__(self, index: int) -> Any:
36        result = self._value[index]
37        return result
38
39    def __setitem__(self, index: int, value: Any):
40        tmp = value
41        self._value[index] = tmp

A dictionary with an indexer that allows accessing elements by their index in addition to the key. The type of the key in the dictionary. The type of the value in the dictionary.

IndexedDictionary(*args, **kwargs)
162        def __init__(self, *args, **kwargs):
163            pass
@staticmethod
def new(*args, **kwargs):
27    @staticmethod
28    def new(*args, **kwargs):
29        """Generic factory method for IndexedDictionary. Use overloads for IDE type hints."""
30        return IndexedDictionary(*args, **kwargs)

Generic factory method for IndexedDictionary. Use overloads for IDE type hints.