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 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 801 bytes Desc: OpenPGP digital signature URL: <http://mail.python.org/pipermail/python-dev/attachments/20170320/c9a2c754/attachment.sig>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4