We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
@overload # force merge
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To replace @overload
@overload
from typing import List, Optional, Tuple, Union, Callable import functools from typing_extensions import reveal_type from typing_extensions import ParamSpec, TypeVar P = ParamSpec("P") R = TypeVar("R") def mpy_port( _func: Optional[Callable[P, R]] = None, /, port: Union[str, List[str]] = "*", feature: Union[str, List[str]] = "*", ) -> Callable[P, R]: """Decorator to mark a function as supported only for a specific MicroPython port.""" ... @mpy_port(port="*") def a(str, i: int = 1) -> Tuple[str, float]: ... @mpy_port(feature="*") def B(str, i: int = 1) -> Tuple[str, float]: ... @mpy_port(port=["esp32", "esp8266"]) def espnow(str, i: int = 1) -> Tuple[str, float]: print("foo") return str * i, float(i) reveal_type(espnow("booh", 32))
merge/enrich functions can evalute the params to determine if a class / method should be made available to a port
will anso need either :
The text was updated successfully, but these errors were encountered:
Josverl
No branches or pull requests
To replace
@overload
merge/enrich functions can evalute the params to determine if a class / method should be made available to a port
will anso need either :
The text was updated successfully, but these errors were encountered: