Skip to content

Commit 26d406f

Browse files
authored
TYP: Use Protocol for ReaderBase (#52915)
1 parent 9f650a2 commit 26d406f

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

pandas/io/sas/sasreader.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
"""
44
from __future__ import annotations
55

6-
from abc import (
7-
ABCMeta,
8-
abstractmethod,
9-
)
106
from typing import (
117
TYPE_CHECKING,
128
Hashable,
9+
Protocol,
1310
overload,
1411
)
1512

@@ -31,19 +28,16 @@
3128
from pandas import DataFrame
3229

3330

34-
# TODO(PY38): replace with Protocol in Python 3.8
35-
class ReaderBase(metaclass=ABCMeta):
31+
class ReaderBase(Protocol):
3632
"""
3733
Protocol for XportReader and SAS7BDATReader classes.
3834
"""
3935

40-
@abstractmethod
4136
def read(self, nrows: int | None = None) -> DataFrame:
42-
pass
37+
...
4338

44-
@abstractmethod
4539
def close(self) -> None:
46-
pass
40+
...
4741

4842
def __enter__(self) -> ReaderBase:
4943
return self

0 commit comments

Comments
 (0)