Skip to content

Commit

Permalink
Extended ad protocol classes
Browse files Browse the repository at this point in the history
small cleanup
  • Loading branch information
Daraan committed Sep 6, 2024
1 parent 39e17e9 commit 1f0ca19
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 1,018 deletions.
149 changes: 62 additions & 87 deletions PythonAPI/carla/source/carla/ad/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Warning:
some functions and attributes are still missing.
"""

from typing import Iterable, Iterator, Protocol, TypeVar, type_check_only
from typing import Iterable, Iterator, Protocol, TypeVar, overload, type_check_only

from typing_extensions import Self

Expand All @@ -21,135 +21,110 @@ __all__ = [

_T = TypeVar('_T')

@type_check_only
class _FloatLike(Protocol):
def __float__(self) -> float: ...

def __add__(self, other: float | Self) -> Self: ...

def __iadd__(self, other: float | Self) -> Self: ...

def __truediv__(self, other: float | Self) -> Self: ...

def __sub__(self, other: float | Self) -> Self: ...

def __isub(self, other: float | Self) -> Self: ...

def __lt__(self, other: float | Self) -> bool: ...

def __le__(self, other: float | Self) -> bool: ...

def __ge__(self, other: float | Self) -> bool: ...

def __gt__(self, other: float | Self) -> bool: ...

def __eq__(self, value: object) -> bool: ...


@type_check_only
class _Vector(Protocol[_T]):

def __getitem__(self, index: int) -> _T:
@overload
def __getitem__(self, index: slice, /) -> list[_T]: ...

@overload
def __getitem__(self, index: int, /) -> _T:
...

def __delitem__(self, index: int):
def __delitem__(self, index: int, /):
...

def __setitem__(self, index: int, value: _T) -> None:
...
@overload
def __setitem__(self, arg2: slice, value: Iterable[_T], /) -> None: ...

@overload
def __setitem__(self, index: int, value: _T, /) -> None: ...

def __len__(self) -> int:
...

def append(self, item: _T) -> None:
...

def count(self, item: _T) -> int:
...

def extend(self, iterable: Iterable[_T]) -> None:
def append(self, item: _T, /) -> None:
...

def index(self, item: _T) -> int:
def extend(self, iterable: Iterable[_T], /) -> None:
...

def insert(self, index: int, item: _T) -> None:
def insert(self, index: int, item: _T, /) -> None:
...

def reverse(self) -> None:
...

def __contains__(self, item: object) -> bool:
def __contains__(self, item: object, /) -> bool:
...

def __iter__(self) -> Iterator[_T]:
...

@type_check_only
class _VectorSequence(_Vector[_T], Protocol):
"""
Adds `count` and `index` methods.
"""

def count(self, item: _T, /) -> int:
...

class _Calculable(Protocol):
def index(self, item: _T, /) -> int:
...

@type_check_only
class _Assignable(Protocol):

cMaxValue: float
cMinValue: float
cPrecisionValue: float
def assign(self, other: Self) -> Self: ...

@classmethod
def getMin(cls) -> Self:
pass
@type_check_only
class _FloatLike(Protocol):
def __float__(self) -> float: ...

@classmethod
def getMax(cls) -> Self:
pass
def __add__(self, other: float | Self) -> Self: ...

@classmethod
def getPrecision(cls) -> Self:
pass
def __iadd__(self, other: float | Self) -> Self: ...

def Valid(self) -> bool:
pass
def __truediv__(self, other: float | Self) -> Self: ...

def ensureValid(self, value: Self) -> Self:
pass
def __sub__(self, other: float | Self) -> Self: ...

def ensureValidNonZero(self, value: Self) -> Self:
pass
def __isub(self, other: float | Self) -> Self: ...

def assign(self, other: Self) -> None:
pass
def __lt__(self, other: float | Self) -> bool: ...

def __truediv__(self, other: Self) -> Self:
pass
def __le__(self, other: float | Self) -> bool: ...

def __mul__(self, other: Self) -> Self: ...

def __sub__(self, other: Self) -> Self:
pass
def __ge__(self, other: float | Self) -> bool: ...

def __isub__(self, other: Self) -> None:
pass
def __gt__(self, other: float | Self) -> bool: ...

def __le__(self, other: Self) -> bool:
pass
def __eq__(self, value: object) -> bool: ...

def __lt__(self, other: Self) -> bool:
pass
@type_check_only
class _Calculable(_Assignable, _FloatLike, Protocol):

def __mul__(self, other: Self) -> Self:
pass
cMaxValue: float
cMinValue: float
cPrecisionValue: float

def __ne__(self, other: Self) -> bool:
pass
@classmethod
def getMin(cls) -> Self: ...

def __add__(self, other: Self) -> Self:
pass
@classmethod
def getMax(cls) -> Self: ...

def __eq__(self, other: Self) -> bool:
pass
@classmethod
def getPrecision(cls) -> Self: ...

def __float__(self) -> float:
pass
@property
def Valid(self) -> bool: ...

def __ge__(self, other: Self) -> bool:
pass
def ensureValid(self, value: Self) -> Self: ...

def __gt__(self, other: Self) -> bool:
pass
def ensureValidNonZero(self, value: Self) -> Self: ...

def __hash__(self) -> int:
pass
def __hash__(self) -> int: ...
Loading

0 comments on commit 1f0ca19

Please sign in to comment.