Skip to content

preparser + match-case = sadness #34678

@yyyyx4

Description

@yyyyx4
sage: x = 2
sage: match x:
....:     case 1: print('hello')
....:     case 2: print('world')
....:
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In [2], line 2
      1 match x:
----> 2     case Integer(1): print('hello')
      3     case Integer(2): print('world')

TypeError: sage.rings.integer.Integer() accepts 0 positional sub-patterns (1 given)

Component: python3

Issue created by migration from https://trac.sagemath.org/ticket/34678

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions