Skip to main content

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

Project description

https://img.shields.io/badge/Language-Python-blue.svg?style=plastic 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/russianidiot/self.py/badges/gpa.svg https://landscape.io/github/russianidiot/self.py/master/landscape.svg?style=flat https://scrutinizer-ci.com/g/russianidiot/self.py/badges/quality-score.png?b=master

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

Feedback github_follow github_issues

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.27.tar.gz (2.3 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