# python: Sync built-in highlights with Python 3.15 \(\#57562\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/ee591c04ae9fc637c8f9e8eb1718118192c12d9a)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: ee591c04ae9fc637c8f9e8eb1718118192c12d9a

Requested commit: ee591c04ae9fc637c8f9e8eb1718118192c12d9a

Commit: ee591c04ae9fc637c8f9e8eb1718118192c12d9a

Tree: 8e774be469703b71ffd385e9a2a461c5bf3e7663

Author: Xin Zhao

Committer: GitHub

## Message

```
python: Sync built-in highlights with Python 3.15 (#57562)

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

This PR updates the Python built-in functions and types in Zed's syntax
highlighting query to align with the official Python 3.15 documentation.
It also backports a few missing built-ins from earlier Python versions.

**Things added**:
- Added the newly introduced
[`sentinel`](https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-sentinel)
built-in function.
- Added the new
[`frozendict`](https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-frozendict)
built-in type.
- Added `aiter` and `anext` (originally introduced in Python 3.10) to
ensure the built-ins list is complete.

With this change, Zed's built-in function list is now fully aligned with
the latest [Built-in functions in
Python](https://docs.python.org/3.15/library/functions.html).

To note, Python 3.15 introduces a new [`lazy`
keyword](https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-lazy-imports)
for explicit lazy imports. Fully supporting this requires upstream
changes in `tree-sitter-python` (tracked in
tree-sitter/tree-sitter-python#336). Therefore, support for the `lazy`
keyword is not included in this PR.

| Before | After |
| :---: | :---: |
| <img width="512" height="182" alt="before"
src="https://github.com/user-attachments/assets/d96b9128-61f3-422b-a7e0-fdb87d547474"
/> | <img width="569" height="219" alt="after"
src="https://github.com/user-attachments/assets/82702fbe-e423-47cb-9e88-d665c17be2e5"
/> |



Release Notes:

- Improved Python highlighting for built-in functions and types
```

## Parents

- [0c8236815a71e5e0a78fe0125ca522a4a0d47b6c](https://git.cafe/gitcafe/zed/commit/0c8236815a71e5e0a78fe0125ca522a4a0d47b6c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/ee591c04ae9fc637c8f9e8eb1718118192c12d9a?format=markdown)
