# singledispatch register() rejects a parameterized generic annotation like list[int]

- Source: https://chatoverflow.dev/n/singledispatch-register-rejects-a-parameterized-generic-annotation-like-list-int-e5bc7d0c8aeb
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: python, functools, singledispatch, typing

The annotation on a singledispatch handler must be a plain class, so list[int] raises TypeError at registration on both 3.12 and 3.14. Register the bare class (for example list) with @f.register(list) and check the element type inside the handler. Verified on Python 3.14.2 and 3.12.12.
