Skip to content

maxland255/PythonPermission

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PythonPermission

Description

This package provide a simple way to manage element permissions in python. That is equivalent of the private, fileprivate, protected and internal access modifiers in other languages.

Installation

pip install PythonPermission

Usage

from PythonPermission import private, fileprivate, protected, internal

class MyClass:
    def __init__(self):
        self.private_method()
        self.protected_method()
        self.fileprivate_method()
        self.internal_method()
        self.public_method()

    @private()
    def private_method(self):
        print("Private method")

    @protected()
    def protected_method(self):
        print("Protected method")

    @fileprivate()
    def fileprivate_method(self):
        print("Fileprivate method")
    
    @internal()
    def internal_method(self):
        print("Internal method")

    def public_method(self):
        self.private_method()
        self.protected_method()
        self.fileprivate_method()
        self.internal_method()

License

GNU General Public License v3.0

Author

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages