Let me show here
pip install -U import-export"""mypack.py"""
import export
def fee():
return 'twee'
@export
def moo():
return 'moow'
@export
class C(object):
pass> from mypack import *
> print(fee())
NameError: name 'fee' is not defined
> print(moo())
moow
> print(C())
<mypack.C object at 0x00********>NB:
> import mypack
> print(mypack.fee())
twee- just add decorated resource name to the tuple
module.__all__
- no requirements, but
sysonly - uses some hack
from sys import modulesand so won't leave beta - does not store itself in module variables
- runs for all version python
- It's free software, see the LICENSE for more details.
- This project is inspired export v.0.1.2 by http://github.com/zsiciarz/export
- Written in CudaText by @Alexey-T
- Lot a thnx SO topic authors https://stackoverflow.com/q/44834
-
export(None)== raise Exception('doesn't work') -
may be implementprivate()public()etc decorator to classes as new version of competing library - next part coming soon!