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.

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.4.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

nr.interface-0.0.4-py2.py3-none-any.whl (11.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nr.interface-0.0.4.tar.gz.

File metadata

  • Download URL: nr.interface-0.0.4.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for nr.interface-0.0.4.tar.gz
Algorithm Hash digest
SHA256 285cd82b932427c9d5c21cdc02ad319f701c4eed201377e2b30485c91eac67a3
MD5 ab51f9bc9759cedd30be2045d6ff929e
BLAKE2b-256 b2d928fcf3e6cd8e386a7d173cfc7a958f8cc52068e2bb939549c5f541447133

See more details on using hashes here.

File details

Details for the file nr.interface-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: nr.interface-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for nr.interface-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5f88579643ea18e1d948d92a49b326aa4585516bf64eb529ae693c4c8bddcc6e
MD5 17d026d2e12effeca08ca94b5df448a2
BLAKE2b-256 3171064d2d6cb5fedbd09fd68932e11d2f0a7e92edd678943e61039b1b255017

See more details on using hashes here.

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