Skip to main content

A simple pythonic module to lock (make read-only) and hide class attributes

Project description

attribmanager

A simple pythonic module to lock (make read-only) and hide class attributes

Installation

pip install attribmanager

Usage

import attribmanger

class example(attribmanger.manage):

	def __init__(self):

		self.mylist = ["item 1", "item2"]
		self.lock("mylist")
		# mylist is read only and cannot be edited now, changing it
		# will raise an error, 

		self.myvar = "foo"
		self.hide("myvar")
		# myvar will not show up anywhere, and cannot be edited

		self.unhide("myvar")
		# Hiding an object without being able to unhide it would be
		# the same as deleting it, that's why you can unhide it

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

attribmanager-1.0.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distributions

attribmanager-1.0.0-py3-none-any.whl (18.8 kB view hashes)

Uploaded Python 3

attribmanager-1.0-py2.py3-none-any.whl (15.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page