Skip to main content

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

Project description

Install

$ [sudo] pip install public

Features

  • replace __all__ with @public.add decorator

before

__all__ = ["func"]

def func():

after

import public

@public.add
def func():

Examples

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

>>> @public.add
    class Cls: pass

>>> print(__all__)
['Cls','func']

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

>>> print(__all__)
['name','name1','name2']

test module __all__

>>> import module
>>> public.test(module)

Links

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

public-2.0.1.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

public-2.0.1-py2.py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 2 Python 3

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