Skip to content

Commit 2bfbaf3

Browse files
committed
Prefer typing.NamedTuple
1 parent 75670d2 commit 2bfbaf3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

importlib_metadata/_collections.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import collections
2+
import typing
23

34

45
# from jaraco.collections 3.3
@@ -24,7 +25,10 @@ def freeze(self):
2425
self._frozen = lambda key: self.default_factory()
2526

2627

27-
class Pair(collections.namedtuple('Pair', 'name value')):
28+
class Pair(typing.NamedTuple):
29+
name: str
30+
value: str
31+
2832
@classmethod
2933
def parse(cls, text):
3034
return cls(*map(str.strip, text.split("=", 1)))

0 commit comments

Comments
 (0)