You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a builtin function has the Flat attribute (as happens in the Union builtin), and we have a particular kind of pattern, the matching will not pass a full flattened list.
and Union has the "Flat" attribute (flatten lists), then the pattern matches, but the eval() method gets passed {1, -1, -2} for list rather than {{1, -1, -2, 2, 3}.
If instead Union does not have the Flat attribute, the pattern matches, and the eval() method gets passed {{1, -1, -2}, {2, 3}} in list.
Context
This behavior is seen in the code. Currently, we omit the flat attribute for Union because of this behavior.
The actual pattern used is a little more complicated since it does not appear in the Union class but instead appears in the Abstract base class _SetOperation as:
"%(name)s[lists__, SameTest->sametest_]"
The text was updated successfully, but these errors were encountered:
Description
When a builtin function has the Flat attribute (as happens in the
Union
builtin), and we have a particular kind of pattern, the matching will not pass a full flattened list.How to Reproduce
Consider this pattern docstring for Union:
"Union[lists__, SameTest->sametest_]"
If we encounter:
and Union has the "Flat" attribute (flatten lists), then the pattern matches, but the
eval()
method gets passed{1, -1, -2}
forlist
rather than{{1, -1, -2, 2, 3}
.If instead
Union
does not have the Flat attribute, the pattern matches, and theeval()
method gets passed{{1, -1, -2}, {2, 3}}
inlist
.Context
This behavior is seen in the code. Currently, we omit the flat attribute for
Union
because of this behavior.The actual pattern used is a little more complicated since it does not appear in the
Union
class but instead appears in the Abstract base class_SetOperation
as:"%(name)s[lists__, SameTest->sametest_]"
The text was updated successfully, but these errors were encountered: