pkpy.pyi 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. from typing import Self, Literal
  2. from linalg import vec2, vec2i
  3. class TValue[T]:
  4. def __new__(cls, value: T) -> Self: ...
  5. @property
  6. def value(self) -> T: ...
  7. # TValue_int = TValue[int]
  8. # TValue_float = TValue[float]
  9. # TValue_vec2i = TValue[vec2i]
  10. # TValue_vec2 = TValue[vec2]
  11. def memory_usage() -> str:
  12. """Return a summary of the memory usage."""
  13. def is_user_defined_type(t: type) -> bool:
  14. """Check if a type is user-defined. This means the type was created by executing python `class` statement."""
  15. def currentvm() -> int:
  16. """Return the current VM index."""
  17. class ComputeThread:
  18. def __init__(self, vm_index: Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]): ...
  19. @property
  20. def is_done(self) -> bool:
  21. """Check if the current job is done."""
  22. def wait_for_done(self) -> None:
  23. """Wait for the current job to finish."""
  24. def last_error(self) -> str | None: ...
  25. def last_retval(self): ...
  26. def exec(self, source: str) -> None: ...
  27. def eval(self, source: str) -> None: ...
  28. def call(self, eval_src: str, *args, **kwargs) -> None: ...
  29. def exec_blocked(self, source: str) -> None: ...
  30. def eval_blocked(self, source: str): ...