Skip to content

Commit 91b26c3

Browse files
tacaswellgreglucas
authored andcommitted
MNT: remove auto-string magic all together
Co-authored-by: Greg Lucas <[email protected]>
1 parent 88b0af4 commit 91b26c3

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

lib/matplotlib/_enums.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@
1010
they define.
1111
"""
1212

13-
from enum import Enum, auto
13+
from enum import Enum
1414
from matplotlib import _docstring
1515

1616

17-
class __AutoStringNameEnum(Enum):
18-
"""Automate the ``name = 'name'`` part of making a (str, Enum)."""
19-
20-
2117
class JoinStyle(str, Enum):
2218
"""
2319
Define how the connection between two line segments is drawn.
@@ -73,12 +69,9 @@ class JoinStyle(str, Enum):
7369
7470
"""
7571

76-
def _generate_next_value_(name, start, count, last_values):
77-
return name
78-
79-
miter = auto()
80-
round = auto()
81-
bevel = auto()
72+
miter = "miter"
73+
round = "round"
74+
bevel = "bevel"
8275

8376
@staticmethod
8477
def demo():
@@ -148,12 +141,9 @@ class CapStyle(str, Enum):
148141
CapStyle.demo()
149142
150143
"""
151-
def _generate_next_value_(name, start, count, last_values):
152-
return name
153-
154-
butt = auto()
155-
projecting = auto()
156-
round = auto()
144+
butt = "butt"
145+
projecting = "projecting"
146+
round = "round"
157147

158148
@staticmethod
159149
def demo():

lib/matplotlib/_enums.pyi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ from enum import Enum
33

44

55
class JoinStyle(str, Enum):
6-
miter = cast(str, ...)
7-
round = cast(str, ...)
8-
bevel = cast(str, ...)
6+
miter = "miter"
7+
round = "round"
8+
bevel = "bevel"
99
@staticmethod
1010
def demo() -> None: ...
1111

1212

1313
class CapStyle(str, Enum):
14-
butt = cast(str, ...)
15-
projecting = cast(str, ...)
16-
round = cast(str, ...)
14+
butt = "butt"
15+
projecting = "projecting"
16+
round = "round"
17+
1718
@staticmethod
1819
def demo() -> None: ...

0 commit comments

Comments
 (0)