Skip to main content

'Interface enforcement'

Project description

Inspects objects/classes to enforce that they respect the zope.interface they declare to implement/provide. It works with zope.interfaces.

Examples

the unit tests provided with the source package contain a lot of examples of how to use the package to validate objects and classes.

Discussion

I have written this package mainly out of a specific need for ensuring that plugins I load into my application would always implement the interfaces they declared to implement. This is a way to ensure that the application using the plugin won’t encounter an exception trying to access an attribute that should be present but is not.

Status

The package is in its early infancy and will not detect an attribute that is created outside the __init__ method or not present directly on the class itself. This could be added in the future if there is enough demand.

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

zinspect-0.2.0.zip (7.7 kB view hashes)

Uploaded source

Built Distribution

zinspect-0.2.0-py2.5.egg (6.2 kB view hashes)

Uploaded 2 5

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page