mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
[Enum] add built-in property to test_test_simple_enum (GH-98453)
This commit is contained in:
parent
8463cb55da
commit
a71b117c3d
1 changed files with 6 additions and 0 deletions
|
|
@ -4376,10 +4376,16 @@ class SimpleColor:
|
|||
CYAN = 1
|
||||
MAGENTA = 2
|
||||
YELLOW = 3
|
||||
@bltns.property
|
||||
def zeroth(self):
|
||||
return 'zeroed %s' % self.name
|
||||
class CheckedColor(Enum):
|
||||
CYAN = 1
|
||||
MAGENTA = 2
|
||||
YELLOW = 3
|
||||
@bltns.property
|
||||
def zeroth(self):
|
||||
return 'zeroed %s' % self.name
|
||||
self.assertTrue(_test_simple_enum(CheckedColor, SimpleColor) is None)
|
||||
SimpleColor.MAGENTA._value_ = 9
|
||||
self.assertRaisesRegex(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue