Skip to content

Commit

Permalink
🔖 version 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed May 19, 2024
1 parent e10b140 commit 840989a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
test:
strategy:
matrix:
py_ver: ['3.8', '3.9', '3.10', '3.11']
py_ver: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tarina"
version = "0.4.4"
version = "0.5.0"
description = "A collection of common utils for Arclet"
authors = [
{name = "RF-Tar-Railt", email = "rf_tar_railt@qq.com"},
Expand Down
5 changes: 4 additions & 1 deletion src/tarina/_lru_c.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ _VT = TypeVar("_VT")
_T = TypeVar("_T")

class LRU(Generic[_KT, _VT]):
def __init__(self, size: int, callback: Callable[[_KT, _VT], Any] | None = ...) -> None: ...
@overload
def __init__(self, size: int, callback: None = None) -> None: ...
@overload
def __init__(self, size: int, callback: Callable[[_KT, _VT], Any]) -> None: ...
def clear(self) -> None: ...
@overload
def get(self, key: _KT) -> _VT | None: ...
Expand Down
4 changes: 2 additions & 2 deletions src/tarina/_lru_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get(self, key: _KT) -> _VT | None: ...
@overload
def get(self, key: _KT, instead: _VT | _T) -> _VT | _T: ...

def get(self, key: _KT, instead: _VT | _T | None = None):
def get(self, key: _KT, instead: _VT | _T | None = None)-> _VT | _T | None:
if key in self.__cache:
self.__cache.move_to_end(key, last=False)
return self.__cache[key]
Expand Down Expand Up @@ -61,7 +61,7 @@ def pop(self, key: _KT) -> _VT | None: ...
@overload
def pop(self, key: _KT, default: _VT | _T) -> _VT | _T: ...

def pop(self, key: _KT, default: _VT | _T | None = None):
def pop(self, key: _KT, default: _VT | _T | None = None)-> _VT | _T:
return self.__cache.pop(key, default)

def popitem(self, least_recent: bool = True) -> tuple[_KT, _VT]:
Expand Down
2 changes: 1 addition & 1 deletion src/tarina/lang/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def delete(args):


def main():
parser = ArgumentParser(description="tarina.lang CLI tool")
parser = ArgumentParser(description="tarina-lang CLI tool")

subparsers = parser.add_subparsers(dest="command")

Expand Down
5 changes: 4 additions & 1 deletion src/tarina/lru.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ _VT = TypeVar("_VT")
_T = TypeVar("_T")

class LRU(Generic[_KT, _VT]):
def __init__(self, size: int, callback: Callable[[_KT, _VT], Any] | None = ...) -> None: ...
@overload
def __init__(self, size: int, callback: None = None) -> None: ...
@overload
def __init__(self, size: int, callback: Callable[[_KT, _VT], Any]) -> None: ...
def clear(self) -> None: ...
@overload
def get(self, key: _KT) -> _VT: ...
Expand Down

0 comments on commit 840989a

Please sign in to comment.