[Python-checkins] [Enum] add built-in property to test_test_simple_enum (GH-98453)

ethanfurman webhook-mailer at python.org
Sun Nov 6 15:03:47 EST 2022


https://github.com/python/cpython/commit/a71b117c3d4e4828057970706d03c2dad8f67c1f
commit: a71b117c3d4e4828057970706d03c2dad8f67c1f
branch: main
author: Ethan Furman <ethan at stoneleaf.us>
committer: ethanfurman <ethan at stoneleaf.us>
date: 2022年11月06日T12:03:42-08:00
summary:
[Enum] add built-in property to test_test_simple_enum (GH-98453)
files:
M Lib/test/test_enum.py
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index 38b1d7c77146..03a9c610a86d 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -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(


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /