@self decorator makes method return self (jQuery-like chaining)
Project description
Install
[sudo] pip install self
Usage
>>> from self import self
>>> @self
def method(self):
Example
>>> class CLS:
@self
def method(self):
print("test")
@self
def method2(self):
print("test")
>>> CLS().method().method2() # jQuery like chain
Sources:
russianidiot.github.io/python/ - Python packages
russianidiot.github.io/cli/ - command line scripts
README.rst - generated with readmemako.py (python+ mako templates) and .README dotfiles
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
self-0.0.10.tar.gz
(6.6 kB
view details)
File details
Details for the file self-0.0.10.tar.gz
.
File metadata
- Download URL: self-0.0.10.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
c4639f4a611183f028f466dd37ee8801d4b27a8bce2f7070f19ff329d5788947
|
|
MD5 |
003ce6cc754faaeaca7d9cc530d3ec1a
|
|
BLAKE2b-256 |
004297e5c64109f7586f5229230d696c514015868f730003bf24392e15cfde33
|