python: Fix Python exception highlighting (#58176)

In the current Python Tree-sitter `highlights.scm`, exception
(https://docs.python.org/3/library/exceptions.html) are highlighted
under `@type.class` which is inconsistent compared to other editors (VS
Code, Neovim, Helix).

This PR adds `#any-of?` with a list of python's exceptions and highlight
them under `@type.builtin`.

| Before | After |
|
:---------------------------------------------------------------------------------------------------------------------------------:
|
:--------------------------------------------------------------------------------------------------------------------------------:
|
| <img width="1237" height="1160" alt="image"
src="https://github.com/user-attachments/assets/05e1ae34-7637-413a-9785-ad696c2bf751"
/> | <img width="1237" height="1154" alt="image"
src="https://github.com/user-attachments/assets/105c61ca-b6a7-4c26-acc8-3e300f044510"
/> |


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Added the ability to stylize builtin python exceptions and warnings
using the `type.class.builtin` syntax capture.
3c0f5a04a6Alex Lachance committed on 6/5/2026, 10:49:28 PM· committed by GitHubparent4278e52
1 file changedLine totals unavailable