# Feature or enhancement ### Proposal: When trying to use a class pattern to match on a non-class object, we currently get the following error message: Traceback (most recent call last): File "/tmp/test.py", line 2, in <module> case len(): ~~~^^ TypeError: called match pattern must be a class The terminology "called match pattern" here is a bit confusing. It's not used anywhere else as far as I can tell, and for a beginner, it might read like something is actually being called here. The documentation consistently refers to these patterns as "class patterns": * https://docs.python.org/3/reference/compound_stmts.html#class-patterns * https://peps.python.org/pep-0635/#class-patterns * https://docs.python.org/3/library/ast.html#ast.MatchClass * https://docs.python.org/3/reference/datamodel.html#customizing-positional-arguments-in-class-pattern-matching I am therefore suggesting to change the message to *"class pattern must refer to a class"*. See https://github.com/python/cpython/pull/103576 for a PR that previously changed this error message (from *"… must be a type"* to *"… must be a class"*). ### Has this already been discussed elsewhere? This is a minor feature, which does not need previous discussion elsewhere ### Links to previous discussion of this feature: _No response_ <!-- gh-linked-prs --> ### Linked PRs * gh-144703 <!-- /gh-linked-prs -->