Skip to content

Commit 44850bd

Browse files
committed
Doc format changed
1 parent 68826d3 commit 44850bd

1 file changed

Lines changed: 39 additions & 70 deletions

File tree

Lib/test/test_enum.py

Lines changed: 39 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4671,118 +4671,87 @@ class TestEnumTypeSubclassing(unittest.TestCase):
46714671
Help on class Color in module %s:
46724672
46734673
class Color(enum.Enum)
4674-
| Create a collection of name/value pairs.
4675-
|\x20\x20
4676-
| Example enumeration:
4677-
|\x20\x20
4678-
| >>> class Color(Enum):
4679-
| ... RED = 1
4680-
| ... BLUE = 2
4681-
| ... GREEN = 3
4682-
|\x20\x20
4683-
| Access them by:
4684-
|\x20\x20
4685-
| - attribute access::
4686-
|\x20\x20
4687-
| >>> Color.RED
4688-
| <Color.RED: 1>
4689-
|\x20\x20
4690-
| - value lookup:
4691-
|\x20\x20
4692-
| >>> Color(1)
4693-
| <Color.RED: 1>
4694-
|\x20\x20
4695-
| - name lookup:
4696-
|\x20\x20
4697-
| >>> Color['RED']
4698-
| <Color.RED: 1>
4699-
|\x20\x20
4700-
| Enumerations can be iterated over, and know how many members they have:
4701-
|\x20\x20
4702-
| >>> len(Color)
4703-
| 3
4704-
|\x20\x20
4705-
| >>> list(Color)
4706-
| [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
4707-
|\x20\x20
4708-
| Methods can be added to enumerations, and members can have their own
4709-
| attributes -- see the documentation for details.
4710-
|\x20\x20
4674+
| Color(*values)
4675+
|
47114676
| Method resolution order:
47124677
| Color
47134678
| enum.Enum
47144679
| builtins.object
4715-
|\x20\x20
4680+
|
47164681
| Data and other attributes defined here:
4717-
|\x20\x20
4682+
|
47184683
| CYAN = <Color.CYAN: 1>
4719-
|\x20\x20
4684+
|
47204685
| MAGENTA = <Color.MAGENTA: 2>
4721-
|\x20\x20
4686+
|
47224687
| YELLOW = <Color.YELLOW: 3>
4723-
|\x20\x20
4688+
|
47244689
| ----------------------------------------------------------------------
47254690
| Data descriptors inherited from enum.Enum:
4726-
|\x20\x20
4691+
|
47274692
| name
47284693
| The name of the Enum member.
4729-
|\x20\x20
4694+
|
47304695
| value
47314696
| The value of the Enum member.
4732-
|\x20\x20
4697+
|
47334698
| ----------------------------------------------------------------------
47344699
| Methods inherited from enum.EnumType:
4735-
|\x20\x20
4736-
| __contains__(member) from enum.EnumType
4737-
| Return True if member is a member of this enum
4738-
| raises TypeError if member is not an enum member
4739-
|\x20\x20\x20\x20\x20\x20
4740-
| note: in 3.12 TypeError will no longer be raised, and True will also be
4741-
| returned if member is the value of a member in this enum
4742-
|\x20\x20
4700+
|
4701+
| __contains__(value) from enum.EnumType
4702+
| Return True if `value` is in `cls`.
4703+
|
4704+
| `value` is in `cls` if:
4705+
| 1) `value` is a member of `cls`, or
4706+
| 2) `value` is the value of one of the `cls`'s members.
4707+
|
47434708
| __getitem__(name) from enum.EnumType
47444709
| Return the member matching `name`.
4745-
|\x20\x20
4710+
|
47464711
| __iter__() from enum.EnumType
47474712
| Return members in definition order.
4748-
|\x20\x20
4713+
|
47494714
| __len__() from enum.EnumType
47504715
| Return the number of members (no aliases)
4751-
|\x20\x20
4716+
|
47524717
| ----------------------------------------------------------------------
4753-
| Data descriptors inherited from enum.EnumType:
4754-
|\x20\x20
4755-
| __members__"""
4718+
| Readonly properties inherited from enum.EnumType:
4719+
|
4720+
| __members__
4721+
| Returns a mapping of member name->value.
4722+
|
4723+
| This mapping lists all enum members, including aliases. Note that this
4724+
| is a read-only view of the internal mapping."""
47564725

47574726
expected_help_output_without_docs = """\
47584727
Help on class Color in module %s:
47594728
47604729
class Color(enum.Enum)
4761-
| Color(value, names=None, *, module=None, qualname=None, type=None, start=1)
4762-
|\x20\x20
4730+
| Color(*values)
4731+
|
47634732
| Method resolution order:
47644733
| Color
47654734
| enum.Enum
47664735
| builtins.object
4767-
|\x20\x20
4736+
|
47684737
| Data and other attributes defined here:
4769-
|\x20\x20
4738+
|
47704739
| YELLOW = <Color.YELLOW: 3>
4771-
|\x20\x20
4740+
|
47724741
| MAGENTA = <Color.MAGENTA: 2>
4773-
|\x20\x20
4742+
|
47744743
| CYAN = <Color.CYAN: 1>
4775-
|\x20\x20
4744+
|
47764745
| ----------------------------------------------------------------------
47774746
| Data descriptors inherited from enum.Enum:
4778-
|\x20\x20
4747+
|
47794748
| name
4780-
|\x20\x20
4749+
|
47814750
| value
4782-
|\x20\x20
4751+
|
47834752
| ----------------------------------------------------------------------
47844753
| Data descriptors inherited from enum.EnumType:
4785-
|\x20\x20
4754+
|
47864755
| __members__"""
47874756

47884757
class TestStdLib(unittest.TestCase):

0 commit comments

Comments
 (0)