Skip to content

Commit

Permalink
Support use of *args with **kwargs on natch.Pattern rule.
Browse files Browse the repository at this point in the history
  • Loading branch information
ertgl committed Jul 4, 2020
1 parent a0a7f8e commit 49c80cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion natch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from natch.rules import Pattern


__version__ = '1.0.2'
__version__ = '1.0.3'


__all__ = [
Expand Down
5 changes: 4 additions & 1 deletion natch/rules/pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def set_args(self, args):
self.args.append(arg)

def does_match(self, *args, **kwargs):
if len(self.args) != len(args):
len_args = len(args)
if len(kwargs):
len_args += 1
if len(self.args) != len_args:
return False
for rule_idx, arg in enumerate(args):
rule = self.args[rule_idx]
Expand Down

0 comments on commit 49c80cf

Please sign in to comment.