mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-04-19 10:57:14 +00:00
Add blog post for deprecated backports and typing aliases (#2139)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
0c40def486
commit
7d76bd8740
21
blog/2024-04-08-deprecated-backports-and-typing-aliases.md
Normal file
21
blog/2024-04-08-deprecated-backports-and-typing-aliases.md
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
author: Marc Mueller
|
||||
authorURL: https://github.com/cdce8p
|
||||
title: "Deprecate old backports and typing alias"
|
||||
---
|
||||
|
||||
In the past, we've backported features from upstream CPython to use them early and improve user and developers' experience. Home Assistant only supports Python 3.12, so these can be used directly from Python. These backports are now deprecated and will be removed in the future.
|
||||
|
||||
| Deprecated | Replacement | Python version |
|
||||
| ---------- | ----------- | -------------- |
|
||||
| `homeassistant.backports.enum.StrEnum` | `enum.StrEnum` | >= 3.11 |
|
||||
| `homeassistant.backports.functools.cached_property` | `functools.cached_property` | >= 3.8, >= 3.12 (performance improvement) |
|
||||
|
||||
In addition, some typing aliases are also deprecated now.
|
||||
|
||||
| Deprecated | Replacement |
|
||||
| ---------- | ----------- |
|
||||
| `homeassistant.helpers.typing.ContextType` | `homeassistant.core.Context` |
|
||||
| `homeassistant.helpers.typing.EventType` | `homeassistant.core.Event` |
|
||||
| `homeassistant.helpers.typing.HomeAssistantType` | `homeassistant.core.HomeAssistant` |
|
||||
| `homeassistant.helpers.typing.ServiceCallType` | `homeassistant.core.ServiceCall` |
|
Loading…
x
Reference in New Issue
Block a user