Thanks to visit codestin.com
Credit goes to github.com

Skip to content

aisk/cadule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cadule

Cadule (short for Ca[llableMo]dule) is a Python library that transforms regular modules into callable objects. By using the decorators provided by cadule, you can make entire modules callable just like functions.

Usage

Example File: hello.py

import cadule

@cadule
def __call__():
    print("Hello World!")

Python REPL Interaction

>>> import hello
>>> hello()
Hello World!
>>> # Now the entire hello module has become a callable object
>>> callable(hello)
True
>>> # You can still access other attributes in the module (if any exist)

As shown above, by simply applying the decorator, the entire hello module becomes a callable object, and calling it executes the decorated __call__ function.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages