Skip to main content

Decorator for resolve function arguments

Project description

https://api.travis-ci.org/zzzsochi/resolver_deco.svg https://coveralls.io/repos/zzzsochi/resolver_deco/badge.svg

Usage

from resolver_deco import resolver


@resolver('obj')
def get_attribute(obj, name):
    return getattr(obj, name)


import os.path
assert get_attribute('os.path', 'isdir') == os.path.isdir

You can resolve more than one argument:

from resolver_deco import resolver


@resolver('obj', 'value')
def set_attribute(obj, name, value):
    return setattr(obj, name, value)


set_attribute('collections.UserDict', 'val', 'os.path')

import collections, os.path
assert collections.UserDict.val is os.path

Tests

$ pip install pytest
$ py.test tests.py -v

Project details


Download files

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

Source Distributions

resolver_deco-1.0.4.tar.gz (1.8 kB view details)

Uploaded Source

resolver_deco-1.0.4.tar.bz2 (1.9 kB view details)

Uploaded Source

File details

Details for the file resolver_deco-1.0.4.tar.gz.

File metadata

File hashes

Hashes for resolver_deco-1.0.4.tar.gz
Algorithm Hash digest
SHA256 110d280171bd7633100d6f1930e7eb7f886f297c4abfcee9f5c675f929bc74fb
MD5 b18f93e2a8b95a6b73778afe9a847444
BLAKE2b-256 371130f030e43dd1cde8f1b8dadb6966646b767d8c83c2d168f4a37c5b86214a

See more details on using hashes here.

File details

Details for the file resolver_deco-1.0.4.tar.bz2.

File metadata

File hashes

Hashes for resolver_deco-1.0.4.tar.bz2
Algorithm Hash digest
SHA256 fd35091b485f71c2c5f91b4592a6c9c0c4b8343696212043443b111772b7fd14
MD5 dc80fee0a5341b66b6ffcb251bf2db32
BLAKE2b-256 f4b53700465decc1148a2f55dfa2b886c7ece6b50575f510d179fb778dd00855

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