Python module which includes private, or protected class methods for your classes.
Project description
Access Modify
Use private, protected class methods in Python!
Download
pip install access-modify
Example
from access_modify import *
@access
class Test:
# Test.a can be used by Test class methods.
@private
def a(self): return 1
# Test.b can be used by Test class, or inherited class methods.
@protected
def b(self): return self.a()+1
class Inherited(Test):
@public
def c(self): return self.b()+1
r = Test()
w = Inherited()
print(r.a()) # raise AccessException
print(r.b()) # raise AccessException
print(w.c()) # 3
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
Access-Modify-1.0.6.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for Access_Modify-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3b2d1acc6feb95b134a71d8892d43e87f79ac1af6cd20a082759e00c0226cc3 |
|
MD5 | 507e15d8a57c23ed2d5cc355a2562a75 |
|
BLAKE2b-256 | 31307022c2ade2e1138b04534f766e4fd7c45ab5e7f5416352b52fe25d8be52f |