Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

replace '__all__' with '@public.add' decorator

Project description

Installation

$ [sudo] pip install public

Features

  • replace __all__ with @public.add decorator

before

__all__ = ["func"]

def func():

after

import public

@public.add
def func():

Functions

function __doc__
public.add(*objects) add objects to __all__
public.public(*objects) add objects to __all__. deprecated
public.test(module) test module __all__

Examples

>>> import public
>>> @public.add
    def func(): pass

>>> @public.add
    class Cls: pass

>>> __all__
['Cls','func']

>>> public.add("name")
>>> public.add(*["name1","name2"])

>>> __all__
['Cls','func','name','name1','name2']

Links

python-readme-generator

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for public, version 2019.4.13
Filename, size File type Python version Upload date Hashes
Filename, size public-2019.4.13.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page