Skip to content

Commit

Permalink
🍻 DirectPat in Union
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Oct 26, 2024
1 parent b2e5dba commit da8c354
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nepattern/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ def __init__(self, *base: Any):
self.optional = True
self.for_equal.append(None)
elif isinstance(arg, Pattern):
self.for_validate.append(arg)
if isinstance(arg, DirectPattern):
self.for_equal.append(arg.target)
else:
self.for_validate.append(arg)
else:
self.for_equal.append(arg)
alias_content = "|".join([str(a) for a in self.for_validate] + [repr(a) for a in self.for_equal])
Expand Down

0 comments on commit da8c354

Please sign in to comment.