ruff/crates/ty_python_semantic/src
David Peter 385d6fa608
[ty] Detect enums if metaclass is a subtype of EnumType/EnumMeta (#19481)
## Summary

This PR implements the following section from the [typing spec on
enums](https://typing.python.org/en/latest/spec/enums.html#enum-definition):

> Enum classes can also be defined using a subclass of `enum.Enum` **or
any class that uses `enum.EnumType` (or a subclass thereof) as a
metaclass**. Note that `enum.EnumType` was named `enum.EnumMeta` prior
to Python 3.11.

part of https://github.com/astral-sh/ty/issues/183

## Test Plan

New Markdown tests
2025-07-23 08:46:51 +02:00
..
module_resolver [ty] Implement non-stdlib stub mapping for classes and functions (#19471) 2025-07-22 12:42:55 +00:00
semantic_index [ty] Use ThinVec for sub segments in PlaceExpr (#19470) 2025-07-22 20:39:39 +02:00
types [ty] Detect enums if metaclass is a subtype of EnumType/EnumMeta (#19481) 2025-07-23 08:46:51 +02:00
util Move fix suggestion to subdiagnostic (#19464) 2025-07-22 10:03:58 -04:00
ast_node_ref.rs [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
db.rs [ty] Track open files in the server (#19264) 2025-07-18 19:33:35 +05:30
dunder_all.rs [ty] Remove ScopedExpressionId (#19019) 2025-07-02 17:57:32 +02:00
lib.rs [ty] Implement non-stdlib stub mapping for classes and functions (#19471) 2025-07-22 12:42:55 +00:00
lint.rs [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
list.rs [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
module_name.rs [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
node_key.rs [ty] Add environment variable to dump Salsa memory usage stats (#18928) 2025-06-26 21:27:51 +00:00
place.rs [ty] add support for nonlocal statements 2025-07-11 09:44:54 -07:00
program.rs [ty] Use python version and path from Python extension (#19012) 2025-07-14 09:47:27 +00:00
pull_types.rs Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
python_platform.rs Hug closing } when f-string expression has a format specifier (#18704) 2025-06-17 07:39:42 +02:00
rank.rs [ty] Garbage-collect reachability constraints (#19414) 2025-07-21 14:16:27 -04:00
semantic_index.rs [ty] Initial implementation of declaration and definition providers. (#19371) 2025-07-16 15:07:24 -07:00
semantic_model.rs [ty] Add caching for submodule completion suggestions (#19408) 2025-07-18 11:54:27 -04:00
site_packages.rs [ty] Use python version and path from Python extension (#19012) 2025-07-14 09:47:27 +00:00
suppression.rs [ty] Reduce number of inline stored definitions per place (#19409) 2025-07-18 18:28:46 +02:00
types.rs Move fix suggestion to subdiagnostic (#19464) 2025-07-22 10:03:58 -04:00
unpack.rs [ty] Remove countme from salsa-structs (#19257) 2025-07-10 11:45:09 +00:00