Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 45325ad

Browse filesBrowse files
tacaswellgreglucas
andcommitted
MNT: remove auto-string magic all together
Co-authored-by: Greg Lucas <greg.m.lucas@gmail.com>
1 parent 5837e94 commit 45325ad
Copy full SHA for 45325ad

File tree

2 files changed

+14
-23
lines changed
Filter options

2 files changed

+14
-23
lines changed

‎lib/matplotlib/_enums.py

Copy file name to clipboardExpand all lines: lib/matplotlib/_enums.py
+7-17Lines 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

Copy file name to clipboardExpand all lines: lib/matplotlib/_enums.pyi
+7-6Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.