Switch metaclass initialization to python 3-compatible syntax (#8326)

This commit is contained in:
Jonathan de Jong 2020-09-16 21:15:55 +02:00 committed by GitHub
parent 44dec6cbc4
commit a3f124b821
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 26 deletions

View file

@ -165,7 +165,9 @@ def get_localpart_from_id(string):
DS = TypeVar("DS", bound="DomainSpecificString")
class DomainSpecificString(namedtuple("DomainSpecificString", ("localpart", "domain"))):
class DomainSpecificString(
namedtuple("DomainSpecificString", ("localpart", "domain")), metaclass=abc.ABCMeta
):
"""Common base class among ID/name strings that have a local part and a
domain name, prefixed with a sigil.
@ -175,8 +177,6 @@ class DomainSpecificString(namedtuple("DomainSpecificString", ("localpart", "dom
'domain' : The domain part of the name
"""
__metaclass__ = abc.ABCMeta
SIGIL = abc.abstractproperty() # type: str # type: ignore
# Deny iteration because it will bite you if you try to create a singleton