Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-25476)

This reverts commit dbac8f40e8.
This commit is contained in:
Ethan Furman 2021-04-19 19:12:24 -07:00 committed by GitHub
parent dbac8f40e8
commit 503cdc7c12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 34 additions and 871 deletions

View file

@ -1463,21 +1463,20 @@ class UnicodeTest(string_tests.CommonTest,
PI = 3.1415926
class Int(enum.IntEnum):
IDES = 15
class Str(enum.StrEnum):
# StrEnum uses the value and not the name for %s etc.
class Str(str, enum.Enum):
ABC = 'abc'
# Testing Unicode formatting strings...
self.assertEqual("%s, %s" % (Str.ABC, Str.ABC),
'abc, abc')
'ABC, ABC')
self.assertEqual("%s, %s, %d, %i, %u, %f, %5.2f" %
(Str.ABC, Str.ABC,
Int.IDES, Int.IDES, Int.IDES,
Float.PI, Float.PI),
'abc, abc, 15, 15, 15, 3.141593, 3.14')
'ABC, ABC, 15, 15, 15, 3.141593, 3.14')
# formatting jobs delegated from the string implementation:
self.assertEqual('...%(foo)s...' % {'foo':Str.ABC},
'...abc...')
'...ABC...')
self.assertEqual('...%(foo)s...' % {'foo':Int.IDES},
'...IDES...')
self.assertEqual('...%(foo)i...' % {'foo':Int.IDES},