Skip to content

Fix wrong type of F.func operator and fixing __slots__ #17

New issue

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"

- name: pip cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}
Expand Down
2 changes: 1 addition & 1 deletion magic_filter/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def regexp(
regexp_func = getattr(pattern, mode)
return self._extend(FunctionOperation(regexp_func))

def func(self: MagicT, func: Callable[[Any], Any], *args: Any, **kwargs: Any) -> MagicT:
def func(self: MagicT, func: Callable[..., Any], *args: Any, **kwargs: Any) -> MagicT:
return self._extend(FunctionOperation(func, *args, **kwargs))

def cast(self: MagicT, func: Callable[[Any], Any]) -> MagicT:
Expand Down
2 changes: 2 additions & 0 deletions magic_filter/operations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@


class BaseOperation(ABC):
__slots__ = ()

important: bool = False

@abstractmethod
Expand Down
Loading