Skip to content

Commit 43d4c2f

Browse files
committed
TYP: Replace namedtuple with dataclass pandas-dev#40531
1 parent 098661e commit 43d4c2f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pandas/core/groupby/base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
"""
66
from __future__ import annotations
77

8-
import collections
8+
import dataclasses
9+
from typing import Hashable
910

10-
OutputKey = collections.namedtuple("OutputKey", ["label", "position"])
11+
12+
@dataclasses.dataclass(order=True, frozen=True)
13+
class OutputKey:
14+
label: Hashable
15+
position: int
1116

1217
# special case to prevent duplicate plots when catching exceptions when
1318
# forwarding methods from NDFrames

0 commit comments

Comments
 (0)