Combining simple and specific property creation

Category: Python - Miscellaneous

This script provides a function that will automate simple property creation, while allowing its users to provide specific fget/fset/fdel methods. By default, a simple property with get, set, and delete methods will be created. Optionally, specific get/set/del methods may be supplied. You can also choose to omit the creation of one or more of the default get/set/del methods via the 'permit' flag: 'r': readable, 'w':writable, 'd':deletable. If you want a property that is readable and deletable, but not writable, use "permit='rd'". Date: 11 March, 2012


Property Creation - Property Combine - Specific Property - Specific - Property - Combine

Homepage: http://code.activestate.com

Developer: code.activestate.com

License: Artistic License, GNU General Public License (GPL)

Operating System: Windows, Linux, Mac OS, BSD, Solaris

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

This script suggests an idiom for property creation that avoids cluttering the class space with get/set/del methods that will not be used directly.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script provides functions for creating simple properties named 'foo' and 'bar' are created for this class.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script provides a function that will automate simple property creation, while allowing its users to provide specific fget/fset/fdel methods.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


The Property class provides basic functionality that allows class level control over how a particular attribute is managed.

developer Developer: Kevin L. Sitze
license License: Freeware
operating systems Operating System: Windows


Presented in this recipe is a function prop, with that a property myprop can be created as simple as:

@prop
def myprop(): pass


It has only 7 lines of code, easy to understand, easy to customize, will make the code look much netter and will save you a lot of typing.

developer Developer: runsun pan
license License: Freeware
operating systems Operating System: Windows


This script presents two approaches to generate all combination of elements from a number of sets.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Use this class to parse RSS at a specific URL.

developer Developer: snippets.dzone.com
license License: Freeware
operating systems Operating System: All


This script brings a Ruby-like class behavior.

developer Developer: code.activestate.com
license License: Artistic License, GNU General Public License (GPL)
operating systems Operating System: Windows, Linux, Mac OS, BSD, Solaris


Dot is a very nice graph description language developed at MIT.

developer Developer: code.activestate.com
license License: Artistic License, GNU General Public License (GPL)
operating systems Operating System: Windows, Linux, Mac OS, BSD, Solaris