Skip to main content

attrcheck: attribution checker

This module provides a simple attribution checker implemented as a decorator. All functionality are provided as keyword arguments of the decorator.

Sample example of usage is following:

>>> from attrcheck import attrcheck
>>> @attrcheck(x=['real'], y=['index', 'strip'], z=dir(list))
... def foo(x, y, z=[]): pass

The code above means the following:

>>> def foo(x, y, z=[]):
...     if not hasattr(x, 'real'):
...         raise AttributeError
...     if not hasattr(y, 'index'):
...         raise AttributeError
...     if not hasattr(y, 'strip'):
...         raise AttributeError
...     for name in dir(list):
...         if not hasattr(z, name):
...             raise AttributeError

In addition, attrcheck can check default argument values. Thus, the following code throws AttributeError.

>>> @attrcheck(y=dir(str))
... def bar(x, y=[]): pass

Release files for attrcheck 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for attrcheck 0.1.2
File Size Uploaded
attrcheck-0.1.2.tar.gz 2.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for attrcheck 0.1.2
File Interpreter ABI Platform
attrcheck-0.1.2-py3.2.egg Legacy Egg format - - Details
attrcheck-0.1.2-py2.7.egg Legacy Egg format - - Details

Total release size: 14.0 kB

Release files / attrcheck-0.1.2.tar.gz

Download URL attrcheck-0.1.2.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2a18d733ecf7def34fbc3e0066ccdf7b996ed54c5213e19788c73ac0075e72ab
BLAKE2b-256 checksum
How to use checksums
1bef5a2aecc3573a6029ee6437e0506ac73ba7b94a8dc986b2f15b62977138c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / attrcheck-0.1.2-py3.2.egg

Download URL attrcheck-0.1.2-py3.2.egg
Size 5.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
c9a63ed68b24324973909aaa209e35ffa452c6547d5a036b761fb1960ac31be6
BLAKE2b-256 checksum
How to use checksums
f4533cc21083cc56575b37ed050f5a9644a42829391801eac2c81d998958d82c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / attrcheck-0.1.2-py2.7.egg

Download URL attrcheck-0.1.2-py2.7.egg
Size 5.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
0031c61b6d3996ebcb0d5a000641156508efbf51e6c65da79aeaca4adacf09a9
BLAKE2b-256 checksum
How to use checksums
ff18ab0e75ff85b0cae037ecfb8f82b60a306d5205b6205d3507227f1b2954c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.2 This release

3 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page