mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-25476)
This reverts commit dbac8f40e8
.
This commit is contained in:
parent
dbac8f40e8
commit
503cdc7c12
20 changed files with 34 additions and 871 deletions
|
@ -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},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue