Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Decorator for resolve function arguments

Project description

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


Release history Release notifications

This version
History Node

1.0.4

History Node

1.0.2

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
resolver_deco-1.0.4.tar.bz2 (1.9 kB) Copy SHA256 hash SHA256 Source None Jul 19, 2016
resolver_deco-1.0.4.tar.gz (1.8 kB) Copy SHA256 hash SHA256 Source None May 30, 2015

Supported by

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