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

codacy.com landscape.io codeclimate.com scrutinizer-ci.com

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

Examples/

Sources:

Feedback github_issues gitter github_follow


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


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)

Uploaded Source

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

Hashes for self-0.0.10.tar.gz
Algorithm Hash digest
SHA256 c4639f4a611183f028f466dd37ee8801d4b27a8bce2f7070f19ff329d5788947
MD5 003ce6cc754faaeaca7d9cc530d3ec1a
BLAKE2b-256 004297e5c64109f7586f5229230d696c514015868f730003bf24392e15cfde33

See more details on using hashes here.

Supported by

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