mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-44342: [Enum] sync current docs to 3.10 (GH-26750)
This commit is contained in:
parent
ac38a9f2df
commit
741b8ae1cf
3 changed files with 4 additions and 4 deletions
|
@ -576,7 +576,7 @@ Data Types
|
||||||
... NEON = 31
|
... NEON = 31
|
||||||
Traceback (most recent call last):
|
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::
|
.. note::
|
||||||
|
|
||||||
|
|
|
@ -1637,7 +1637,7 @@ class verify:
|
||||||
else:
|
else:
|
||||||
value = 'combined values of 0x%x' % missing_value
|
value = 'combined values of 0x%x' % missing_value
|
||||||
raise ValueError(
|
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)
|
% (cls_name, alias, value)
|
||||||
)
|
)
|
||||||
return enumeration
|
return enumeration
|
||||||
|
|
|
@ -3614,7 +3614,7 @@ class TestVerify(unittest.TestCase):
|
||||||
self.assertEqual(Bizarre.d.value, 6)
|
self.assertEqual(Bizarre.d.value, 6)
|
||||||
with self.assertRaisesRegex(
|
with self.assertRaisesRegex(
|
||||||
ValueError,
|
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)
|
@verify(NAMED_FLAGS)
|
||||||
class Bizarre(Flag):
|
class Bizarre(Flag):
|
||||||
|
@ -3633,7 +3633,7 @@ class TestVerify(unittest.TestCase):
|
||||||
self.assertEqual(Bizarre.d.value, 6)
|
self.assertEqual(Bizarre.d.value, 6)
|
||||||
with self.assertRaisesRegex(
|
with self.assertRaisesRegex(
|
||||||
ValueError,
|
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)
|
@verify(NAMED_FLAGS)
|
||||||
class Bizarre(IntFlag):
|
class Bizarre(IntFlag):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue