Skip to main content

Interface definitions for Python.

Project description

Note: This package is in the dangerous land of 0.x.y versions and may be subject to breaking changes with minor version increments.

Important: Development of nr.interface is discontinued. We recommend to use the abc module instead.

nr.interface

Interface definitions for Python. Inspired by zope.interface.

Quickstart

from nr.interface import Interface, implements, override

class Pet(Interface):

  def make_sound(self) -> str:
    pass

@implements(Pet)
class Dog:

  @override
  def make_sound(self) -> str:
    return 'Bark!'

assert 'make_sound' in Pet.members
assert Pet.implemented_by(Dog)
assert list(Pet.implementations()) == [Dog]

Copyright © 2020 Niklas Rosenstein

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nr.interface-0.0.5.tar.gz (11.5 kB view hashes)

Uploaded Source

Built Distribution

nr.interface-0.0.5-py2.py3-none-any.whl (11.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page