Release/v0.4.1 #1

Merged
rus07tam merged 12 commits from release/v0.4.1 into main 2025-10-27 15:05:33 +03:00
2 changed files with 15 additions and 0 deletions
Showing only changes of commit e7e6491cc3 - Show all commits

View file

@ -4,6 +4,7 @@ from .bindable import Bindable
from .chain import chain
from .combine import combine
from .concat import concat
from .cond import cond
from .const import const
from .filter import filter # noqa: W0622 # pylint: disable=W0622
from .map import map # noqa: W0622 # pylint: disable=W0622
@ -18,6 +19,7 @@ __all__ = [
"chain",
"combine",
"concat",
"cond",
"const",
"filter",
"map",

View file

@ -0,0 +1,13 @@
from typing import Callable
def cond[**P, T, F](
codacy-production[bot] commented 2025-10-27 15:04:50 +03:00 (Migrated from github.com)

🚫 Codacy found a high ErrorProne issue: expected '(' (F999)

The issue reported by the Prospector linter is due to the incorrect syntax used for the type parameters in the function definition. In Python's type hinting, you cannot use square brackets [] for defining type variables; instead, you should use parentheses () with the TypeVar function from the typing module.

To fix the issue, you need to change the definition of the cond function to use TypeVar for the type parameters. Here's the single line change needed:

def cond(P, T, F)(condition: Callable[P, bool], if_true: Callable[P, T], if_false: Callable[P, F]) -> Callable[P, T | F]:

This comment was generated by an experimental AI tool.

:no_entry_sign: **Codacy** found a **high ErrorProne** issue: [expected '(' (F999)](https://app.codacy.com/gh/RuJect/snakia/pull-requests/1) The issue reported by the Prospector linter is due to the incorrect syntax used for the type parameters in the function definition. In Python's type hinting, you cannot use square brackets `[]` for defining type variables; instead, you should use parentheses `()` with the `TypeVar` function from the `typing` module. To fix the issue, you need to change the definition of the `cond` function to use `TypeVar` for the type parameters. Here's the single line change needed: ```suggestion def cond(P, T, F)(condition: Callable[P, bool], if_true: Callable[P, T], if_false: Callable[P, F]) -> Callable[P, T | F]: ``` --- *This comment was generated by an experimental AI tool.*
condition: Callable[P, bool],
if_true: Callable[P, T],
if_false: Callable[P, F],
) -> Callable[P, T | F]:
return lambda *args, **kw: (
if_true(*args, **kw)
if condition(*args, **kw)
else if_false(*args, **kw)
)