Skip to main content
# Forwardable

pythoniac port forwardable from Ruby


## Installation

```bash
$ pip install https://github.com/hachibeeDI/forwardable/archive/master.zip
```


## Example

### delegator

```python
>>> from forwardable import Forwardable, def_delegator
>>> class Hoge(object):
... __metaclass__ = Forwardable
... startswith = def_delegator('aa')
... endswith = def_delegator('aa')
... balse = def_delegator('aa', 'replace') # with proxy
...
... def __init__(self):
... self.aa = 'test hoge'

>>> h = Hoge()
>>> h.startswith('test')
True
>>> h.endswith('test')
False
>>> h.balse('test', 'is it greeeeet')
'is it greeeeet hoge'

```

### multi delegators

```python

>>> from forwardable import Forwardable, def_delegators
>>> class Foo(object):
... __metaclass__ = Forwardable
... _ = def_delegators('aa', ('startswith', 'endswith', 'replace', ))
...
... def __init__(self):
... self.aa = 'test hoge'

>>> f = Foo()
>>> f.startswith('test')
True
>>> f.endswith('test')
False
>>> f.replace('test', 'is it greeeeet')
'is it greeeeet hoge'

```

## Testing

```bash
python tests.py
```

Metadata

Release files for forwardable.py 0.0.11

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

Source distribution (sdist)

Source distribution for forwardable.py 0.0.11
File Size Uploaded Provenance Actions
forwardable.py-0.0.11.tar.gz 2.9 kB Without provenance Details for forwardable.py-0.0.11.tar.gz

Release files / forwardable.py-0.0.11.tar.gz

Download URL forwardable.py-0.0.11.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6759ec30430c476fae27b1a4f8a1f6761b416c118187e8d3fe6adc62e6ee827f
BLAKE2b-256 checksum
How to use checksums
1bc86daccc28c6fc99696d4decf174689e64e0ce55cddaab34d8c9f07991fd21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for forwardable.py 0.0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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