On Mar 20, 2017, at 01:00 PM, Ivan Levkivskyi wrote: > from zope.interface import Interface, Attribute, implements > > class IEmployee(Interface): > > name = Attribute("Name of employee") > > def do(work): > """Do some work""" > > class Employee(object): > implements(IEmployee)
IIUC, the Python 3 way to spell this is with a decorator. from zope.interface import implementer @implementer(IEmployee) class Employee: (also, since this is Python 3, do you really need to inherit from object?) Cheers, -Barry
pgpieJvP53ib2.pgp
Description: OpenPGP digital signature
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com