Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pure_interface/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ def _type_is_interface(cls: type) -> bool:
"""Return True if cls is a pure interface or an empty ABC class"""
if cls is object:
return False
if cls.__module__ == "collections.abc":
return True
if hasattr(cls, "_pi"):
return cls._pi.type_is_interface
if cls is Generic:
Expand Down
6 changes: 6 additions & 0 deletions tests/test_no_content_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# --------------------------------------------------------------------------------------------

import abc
import collections.abc
import unittest

import pure_interface
Expand Down Expand Up @@ -106,3 +107,8 @@ class IAnimal(pure_interface.Interface):
@property
def height(self):
return self

def test_std_lib_abc_passes(self):

class ITest(collections.abc.Sized, pure_interface.Interface):
pass
Loading