Skip to content

Pattern matching broken #620

@henryiii

Description

@henryiii

The following MWE fails on GraalPy, but works on CPython:

x = sum
match x:
    case object(factor=x) if x is not None:
        print("Has non-None factor")
    case x if callable(x):
        print("Callable")

CPython:

Callable

GraalPy:

Traceback (most recent call last):
  File "/Users/henryfs/git/scikit-hep/boost-histogram/tmp.py", line 3, in <module>
    case object(factor=x) if x is not None:
AttributeError: 'builtin_function_or_method' object has no attribute 'factor'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions