mirror of https://github.com/python/cpython
bpo-44342: [Enum] sync current docs to 3.10 (GH-26750)
This commit is contained in:
parent
ac38a9f2df
commit
741b8ae1cf
|
@ -576,7 +576,7 @@ Data Types
|
|||
... NEON = 31
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValueError: invalid Flag 'Color': 'WHITE' is missing a named flag for value 8; 'NEON' is missing named flags for values 8, 16
|
||||
ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing combined values of 0x18 [use enum.show_flag_values(value) for details]
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
|
@ -1637,7 +1637,7 @@ class verify:
|
|||
else:
|
||||
value = 'combined values of 0x%x' % missing_value
|
||||
raise ValueError(
|
||||
'invalid Flag %r: %s %s [use `enum.show_flag_values(value)` for details]'
|
||||
'invalid Flag %r: %s %s [use enum.show_flag_values(value) for details]'
|
||||
% (cls_name, alias, value)
|
||||
)
|
||||
return enumeration
|
||||
|
|
|
@ -3614,7 +3614,7 @@ class TestVerify(unittest.TestCase):
|
|||
self.assertEqual(Bizarre.d.value, 6)
|
||||
with self.assertRaisesRegex(
|
||||
ValueError,
|
||||
"invalid Flag 'Bizarre': aliases b and d are missing combined values of 0x3 .use `enum.show_flag_values.value.` for details.",
|
||||
"invalid Flag 'Bizarre': aliases b and d are missing combined values of 0x3 .use enum.show_flag_values.value. for details.",
|
||||
):
|
||||
@verify(NAMED_FLAGS)
|
||||
class Bizarre(Flag):
|
||||
|
@ -3633,7 +3633,7 @@ class TestVerify(unittest.TestCase):
|
|||
self.assertEqual(Bizarre.d.value, 6)
|
||||
with self.assertRaisesRegex(
|
||||
ValueError,
|
||||
"invalid Flag 'Bizarre': alias d is missing value 0x2 .use `enum.show_flag_values.value.` for details.",
|
||||
"invalid Flag 'Bizarre': alias d is missing value 0x2 .use enum.show_flag_values.value. for details.",
|
||||
):
|
||||
@verify(NAMED_FLAGS)
|
||||
class Bizarre(IntFlag):
|
||||
|
|
Loading…
Reference in New Issue