forked from Mirror/pmbootstrap
helpers: package: overload types (MR 2344)
Correct return types based on arguments Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
afbecb7184
commit
852efe1f8e
1 changed files with 10 additions and 1 deletions
|
@ -10,7 +10,7 @@ See also:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
from typing import Any
|
from typing import Any, overload
|
||||||
from pmb.core.arch import Arch
|
from pmb.core.arch import Arch
|
||||||
from pmb.core.context import get_context
|
from pmb.core.context import get_context
|
||||||
from pmb.helpers import logging
|
from pmb.helpers import logging
|
||||||
|
@ -28,6 +28,15 @@ def remove_operators(package):
|
||||||
break
|
break
|
||||||
return package
|
return package
|
||||||
|
|
||||||
|
@overload
|
||||||
|
def get(pkgname: str, arch: Arch, replace_subpkgnames: bool=False) -> dict[str, Any]:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
@overload
|
||||||
|
def get(pkgname: str, arch: Arch, replace_subpkgnames: bool=False, must_exist: bool=True) -> dict[str, Any] | None:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
@Cache("pkgname", "arch", "replace_subpkgnames")
|
@Cache("pkgname", "arch", "replace_subpkgnames")
|
||||||
def get(pkgname, arch, replace_subpkgnames=False, must_exist=True):
|
def get(pkgname, arch, replace_subpkgnames=False, must_exist=True):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue