Files
lab_retro/blessed/formatters.pyi
root 52c1128ed4 When I run the game, it works for a bit but then when the first asteroid
gets to the bottom I get this:

Traceback (most recent call last):
  File "/root/making_with_code/mwc1/unit3/lab_retro/nav_game.py", line 14, in <module>
    game.play()
  File "/root/making_with_code/mwc1/unit3/lab_retro/retro/game.py", line 80, in play
    agent.play_turn(self)
  File "/root/making_with_code/mwc1/unit3/lab_retro/asteroid.py", line 16, in play_turn
    game.remove_agent_by_name(self.name)
AttributeError: 'Asteroid' object has no attribute 'name'
2024-12-12 16:42:57 -05:00

71 lines
2.0 KiB
Python

# std imports
from typing import (Any,
Set,
List,
Type,
Tuple,
Union,
TypeVar,
Callable,
NoReturn,
Optional,
overload)
# local
from .terminal import Terminal
COLORS: Set[str]
COMPOUNDABLES: Set[str]
_T = TypeVar("_T")
class ParameterizingString(str):
def __new__(cls: Type[_T], cap: str, normal: str = ..., name: str = ...) -> _T: ...
@overload
def __call__(
self, *args: int
) -> Union["FormattingString", "NullCallableString"]: ...
@overload
def __call__(self, *args: str) -> NoReturn: ...
class ParameterizingProxyString(str):
def __new__(
cls: Type[_T],
fmt_pair: Tuple[str, Callable[..., Tuple[object, ...]]],
normal: str = ...,
name: str = ...,
) -> _T: ...
def __call__(self, *args: Any) -> "FormattingString": ...
class FormattingString(str):
def __new__(cls: Type[_T], sequence: str, normal: str = ...) -> _T: ...
@overload
def __call__(self, *args: int) -> NoReturn: ...
@overload
def __call__(self, *args: str) -> str: ...
class FormattingOtherString(str):
def __new__(
cls: Type[_T], direct: ParameterizingString, target: ParameterizingString = ...
) -> _T: ...
def __call__(self, *args: Union[int, str]) -> str: ...
class NullCallableString(str):
def __new__(cls: Type[_T]) -> _T: ...
@overload
def __call__(self, *args: int) -> "NullCallableString": ...
@overload
def __call__(self, *args: str) -> str: ...
def get_proxy_string(
term: Terminal, attr: str
) -> Optional[ParameterizingProxyString]: ...
def split_compound(compound: str) -> List[str]: ...
def resolve_capability(term: Terminal, attr: str) -> str: ...
def resolve_color(
term: Terminal, color: str
) -> Union[NullCallableString, FormattingString]: ...
def resolve_attribute(
term: Terminal, attr: str
) -> Union[ParameterizingString, FormattingString]: ...