Skip to content

Commit

Permalink
Types cleanup (#215)
Browse files Browse the repository at this point in the history
* types for unindent

* moved types for libs aside from std to own stubs

* moved std types to `_std.pyi` file

* clean up more types

* fix JSON type(s)
  • Loading branch information
jessekrubin authored Mar 6, 2025
1 parent 4de5875 commit 53f82fc
Show file tree
Hide file tree
Showing 15 changed files with 518 additions and 448 deletions.
5 changes: 5 additions & 0 deletions python/ry/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,25 @@
from __future__ import annotations

import sys
from os import PathLike
from typing import TypedDict

if sys.version_info >= (3, 12):
from collections.abc import Buffer
else:
from typing_extensions import Buffer

__all__ = (
"Buffer",
"DateTimeTypedDict",
"DateTypedDict",
"FsPathLike",
"TimeSpanTypedDict",
"TimeTypedDict",
)

FsPathLike = str | PathLike[str]


# =============================================================================
# JIFF
Expand Down
14 changes: 2 additions & 12 deletions python/ry/ryo3/JSON.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,5 @@ def parse_json_bytes(
catch_duplicate_keys: bool = False,
float_mode: Literal["float", "decimal", "lossless-float"] | bool = False,
) -> JsonValue: ...
def parse_json_str(
data: str,
/,
*,
allow_inf_nan: bool = True,
cache_mode: Literal[True, False, "all", "keys", "none"] = "all",
partial_mode: Literal[True, False, "off", "on", "trailing-strings"] = False,
catch_duplicate_keys: bool = False,
float_mode: Literal["float", "decimal", "lossless-float"] | bool = False,
) -> JsonValue: ...
def jiter_cache_clear() -> None: ...
def jiter_cache_usage() -> int: ...
def json_cache_clear() -> None: ...
def json_cache_usage() -> int: ...
Loading

0 comments on commit 53f82fc

Please sign in to comment.