Skip to content

Commit

Permalink
fixed?
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatera committed Sep 17, 2024
1 parent 6155605 commit 343c670
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions mathics/core/pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def match_element(
if len(element_candidates) < match_count[0]:
return

candidates = rest_expression[1]
candidates = tuple(rest_expression[1])

# "Artificially" only use more elements than specified for some kind
# of pattern.
Expand Down Expand Up @@ -901,7 +901,7 @@ def expression_pattern_match_element_orderless(
):
needed = existing.elements
else:
needed = [existing]
needed = (existing,)
available = list(candidates)
for needed_element in needed:
if (
Expand All @@ -911,7 +911,15 @@ def expression_pattern_match_element_orderless(
available.remove(needed_element)
else:
return set()
sets = [(needed, ([], available))]
sets = [
(
needed,
(
[],
available,
),
)
]

if sets is None:
sets = subsets(
Expand All @@ -920,7 +928,7 @@ def expression_pattern_match_element_orderless(
less_first=less_first,
*set_lengths,
)
return sets
return tuple(((tuple(q) for q in s) for s in sets))


def expression_pattern_match_element_process_items(
Expand Down
Binary file removed mathics/doc/latex/mathics-title.pdf
Binary file not shown.

0 comments on commit 343c670

Please sign in to comment.