|
14 | 14 | from matplotlib import _docstring
|
15 | 15 |
|
16 | 16 |
|
17 |
| -class _AutoStringNameEnum(Enum): |
18 |
| - """Automate the ``name = 'name'`` part of making a (str, Enum).""" |
19 |
| - |
20 |
| - def _generate_next_value_(name, start, count, last_values): |
21 |
| - return name |
22 |
| - |
23 |
| - def __hash__(self): |
24 |
| - return str(self).__hash__() |
25 |
| - |
26 |
| - |
27 |
| -class JoinStyle(str, _AutoStringNameEnum): |
| 17 | +class JoinStyle(str, Enum): |
28 | 18 | """
|
29 | 19 | Define how the connection between two line segments is drawn.
|
30 | 20 |
|
@@ -79,6 +69,12 @@ class JoinStyle(str, _AutoStringNameEnum):
|
79 | 69 |
|
80 | 70 | """
|
81 | 71 |
|
| 72 | + def _generate_next_value_(name, start, count, last_values): |
| 73 | + return name |
| 74 | + |
| 75 | + def __hash__(self): |
| 76 | + return str(self).__hash__() |
| 77 | + |
82 | 78 | miter = auto()
|
83 | 79 | round = auto()
|
84 | 80 | bevel = auto()
|
@@ -116,7 +112,7 @@ def plot_angle(ax, x, y, angle, style):
|
116 | 112 | + "}"
|
117 | 113 |
|
118 | 114 |
|
119 |
| -class CapStyle(str, _AutoStringNameEnum): |
| 115 | +class CapStyle(str, Enum): |
120 | 116 | r"""
|
121 | 117 | Define how the two endpoints (caps) of an unclosed line are drawn.
|
122 | 118 |
|
@@ -151,6 +147,13 @@ class CapStyle(str, _AutoStringNameEnum):
|
151 | 147 | CapStyle.demo()
|
152 | 148 |
|
153 | 149 | """
|
| 150 | + |
| 151 | + def _generate_next_value_(name, start, count, last_values): |
| 152 | + return name |
| 153 | + |
| 154 | + def __hash__(self): |
| 155 | + return str(self).__hash__() |
| 156 | + |
154 | 157 | butt = auto()
|
155 | 158 | projecting = auto()
|
156 | 159 | round = auto()
|
|
0 commit comments