UNKNOWN
Project description
Also
====
Ever had lots of methods that do the same thing?!
You want to set them to the same thing but dont want to do something lame like
```python
def method(self):
pass
othermethod = method
```
Rather you want to do it with style like
```python
@also('othermethod')
def method(self):
pass
```
Then do I have a solution for you!
###### Basic Usage
```python
from also import also, AlsoMetaClass
class Foo:
__metaclass__ = AlsoMetaClass
@also('getThing')
@also('get_thing')
def getthing(self):
return 'go bears'
foo = Foo()
assert (foo.getthing() == foo.get_thing() ==
foo.getThing() == 'go bears')
```
====
Ever had lots of methods that do the same thing?!
You want to set them to the same thing but dont want to do something lame like
```python
def method(self):
pass
othermethod = method
```
Rather you want to do it with style like
```python
@also('othermethod')
def method(self):
pass
```
Then do I have a solution for you!
###### Basic Usage
```python
from also import also, AlsoMetaClass
class Foo:
__metaclass__ = AlsoMetaClass
@also('getThing')
@also('get_thing')
def getthing(self):
return 'go bears'
foo = Foo()
assert (foo.getthing() == foo.get_thing() ==
foo.getThing() == 'go bears')
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
also-0.0.1.tar.gz
(1.3 kB
view details)
File details
Details for the file also-0.0.1.tar.gz
.
File metadata
- Download URL: also-0.0.1.tar.gz
- Upload date:
- Size: 1.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37def32fbe90bfc6dfcee9e33d35970945f60e814134ef76ac1a1027cef9241e |
|
MD5 | 24d9325351d861e5996942c25e5adcd5 |
|
BLAKE2b-256 | 34aaf9268590e75cbeda1523c6a51027f17f1c141ba576e9a9e577f4e35a2284 |