mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Add _generate_next_value_ to StrEnum (#10390)
Fixes https://github.com/python/typeshed/issues/10384 Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
13
test_cases/stdlib/check_enum.py
Normal file
13
test_cases/stdlib/check_enum.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import sys
|
||||
from typing_extensions import Literal, assert_type
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
|
||||
class Foo(enum.StrEnum):
|
||||
X = enum.auto()
|
||||
|
||||
assert_type(Foo.X, Literal[Foo.X])
|
||||
assert_type(Foo.X.value, str)
|
||||
Reference in New Issue
Block a user