Skip to content

Chapter 3: 07 - Structural pattern matching - positional_points.py #16

Description

@stone2014
(venv313) ➜  07 - Structural pattern matching git:(main) python positional_points.py 
Traceback (most recent call last):
  File "~/programming/Expert-Python-Programming-Fourth-Edition/Chapter 3/07 - Structural pattern matching/positional_points.py", line 26, in <module>
    where_is(Point(1, 20))
    ~~~~~~~~^^^^^^^^^^^^^^
  File "~/programming/Expert-Python-Programming-Fourth-Edition/Chapter 3/07 - Structural pattern matching/positional_points.py", line 14, in where_is
    case Point(0, 0):
         ~~~~~^^^^^^
TypeError: Point.__match_args__ must be a tuple (got list)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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