mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
Revert "bpo-40066: [Enum] update str() and format() output (GH-30582)" (GH-30632)
This reverts commit acf7403f9b
.
This commit is contained in:
parent
7f4b69b907
commit
42a64c03ec
14 changed files with 2021 additions and 2087 deletions
|
@ -1490,10 +1490,8 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
# issue18780
|
||||
import enum
|
||||
class Float(float, enum.Enum):
|
||||
# a mixed-in type will use the name for %s etc.
|
||||
PI = 3.1415926
|
||||
class Int(enum.IntEnum):
|
||||
# IntEnum uses the value and not the name for %s etc.
|
||||
IDES = 15
|
||||
class Str(enum.StrEnum):
|
||||
# StrEnum uses the value and not the name for %s etc.
|
||||
|
@ -1510,10 +1508,8 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
# formatting jobs delegated from the string implementation:
|
||||
self.assertEqual('...%(foo)s...' % {'foo':Str.ABC},
|
||||
'...abc...')
|
||||
self.assertEqual('...%(foo)r...' % {'foo':Int.IDES},
|
||||
'...<Int.IDES: 15>...')
|
||||
self.assertEqual('...%(foo)s...' % {'foo':Int.IDES},
|
||||
'...15...')
|
||||
'...IDES...')
|
||||
self.assertEqual('...%(foo)i...' % {'foo':Int.IDES},
|
||||
'...15...')
|
||||
self.assertEqual('...%(foo)d...' % {'foo':Int.IDES},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue