Skip to content

Commit d1ea0bf

Browse files
Add subclass checks to ProperSequence
1 parent fac858f commit d1ea0bf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cons/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def __init__(self):
172172
raise NotImplementedError()
173173

174174

175-
class ProperSequenceType(ABCMeta):
175+
class ProperSequenceType(MaybeConsType):
176176
"""An abstract type that can be used as an instance check for proper sequences.
177177
178178
A proper sequence is a sequence according to `cons` but not a `ConsPair`.

tests/test_cons.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ def test_proper_sequence_type():
8787
assert isinstance([], ProperSequence)
8888
assert isinstance((1, 2, 3), ProperSequence)
8989

90+
assert not issubclass(ConsPair, ProperSequence)
91+
assert not issubclass(str, ProperSequence)
92+
assert not issubclass(int, ProperSequence)
93+
assert issubclass(list, ProperSequence)
94+
assert issubclass(tuple, ProperSequence)
95+
9096

9197
def test_cons_join():
9298

0 commit comments

Comments
 (0)