Skip to main content

@self decorator makes method return self (jQuery-like chaining)

Project description

https://img.shields.io/badge/language-Python-blue.svg https://img.shields.io/pypi/pyversions/self.svg https://img.shields.io/pypi/v/self.svg

https://api.codacy.com/project/badge/Grade/34c672515f7b472fb120e9608979f47d https://codeclimate.com/github/looking-for-a-job/self.py/badges/gpa.svg https://img.shields.io/scrutinizer/g/looking-for-a-job/self.py.svg https://sonarcloud.io/api/project_badges/measure?project=self.py&metric=code_smells https://sonarcloud.io/api/project_badges/measure?project=self.py&metric=reliability_rating

Install

`[sudo] pip install self`

Usage

>>> from self import self

>>> @self
    def method(self):

Examples

>>> class CLS:
    @self
    def method(self):
            print("test")

    @self
    def method2(self):
            print("test")

>>> CLS().method().method2() # jQuery like chain

Project details


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.28.tar.gz (2.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page