Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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.

Files for resolver_deco, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size resolver_deco-1.0.4.tar.bz2 (1.9 kB) File type Source Python version None Upload date Hashes View hashes
Filename, size resolver_deco-1.0.4.tar.gz (1.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page