mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-09 18:02:19 +00:00
![]() ## Summary Rename `TypeAliasType::Bare` to `TypeAliasType::ManualPEP695`, and `BareTypeAliasType` to `ManualPEP695TypeAliasType`. Why? Both existing variants of `TypeAliasType` are specific to features added in PEP 695 (which introduced both the `type` statement and `types.TypeAliasType`), so it doesn't make sense to name one with the name `PEP695` and not the other. A "bare" type alias, in my mind, is a legacy type alias like `IntOrStr = int | str`, which is "bare" in that there is nothing at all distinguishing it as a type alias. I will want to use the "bare" name for this variant, in a future PR. The renamed variant here describes a type alias created with `IntOrStr = types.TypeAliasType("IntOrStr", int | str)`, which is not "bare", it's just "manually" instantiated instead of using the `type` statement syntax sugar. (This is useful when using the `typing_extensions` backport of `TypeAliasType` on older Python versions.) ## Test Plan Pure rename, existing tests pass. |
||
---|---|---|
.. | ||
resources | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
mdtest.py | ||
mdtest.py.lock |