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.8.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for Access_Modify-1.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 206f546350d926591b0b161db321dee0dcb327b71ae3ffefb9b6ca124a09421a |
|
MD5 | e2bbe2d31e0591384a6c767585c964f2 |
|
BLAKE2b-256 | 74bb2d8396f12b46db422ea477e7eee4125aeafa030e5a71d6b49451e2343f54 |