Skip to content

Commit

Permalink
Minor cleanup of #202.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Apr 7, 2020
1 parent a404e5f commit bcfa537
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/zope/interface/common/__init__.py
Expand Up @@ -259,5 +259,14 @@ def getRegisteredConformers(self):
return set(itertools.chain(registered, self.__extra_classes))


ABCInterface = ABCInterfaceClass.__new__(ABCInterfaceClass, 'ABCInterface', (), {})
InterfaceClass.__init__(ABCInterface, 'ABCInterface', (Interface,), {})
def _create_ABCInterface():
# It's a two-step process to create the root ABCInterface, because
# without specifying a corresponding ABC, using the normal constructor
# gets us a plain InterfaceClass object, and there is no ABC to associate with the
# root.
abc_name_bases_attrs = ('ABCInterface', (Interface,), {})
instance = ABCInterfaceClass.__new__(ABCInterfaceClass, *abc_name_bases_attrs)
InterfaceClass.__init__(instance, *abc_name_bases_attrs)
return instance

ABCInterface = _create_ABCInterface()

0 comments on commit bcfa537

Please sign in to comment.