Scroll Down to See All▾
absaiterallanextanyasciibinboolbreakpointbytearraybytescallablechrclassmethodcompilecomplexdelattrdictdivmodenumerateevalexecfilterfloatformatfrozensetgetattrglobalshasattrhashhelphexidinputintisinstanceissubclassiterlenlistlocalsmapmaxmemoryviewminnextobjectoctopenordpowprintrangereprreversedroundsetsetattrslicesortedstaticmethodstrsumsupertupletypevarszip__import__clear_(dict)clear_(list)clear_(set)copy_(dict)copy_(list)copy_(set)fromkeysgetitemskeyspop_(dict)pop_(list)pop_(set)popitemsetdefaultupdatevaluescount_(tuple)count_(list)count_(str)index_(tuple)index_(list)index_(str)adddifferencedifference_updatediscardintersectionintersection_updateisdisjointissubsetissupersetremove_(set)remove_(list)symmetric_differencesymmetric_difference_updateunionupdateclosefilenoflushisattyreadreadablereadlinereadlinesseekseekabletelltruncatewritablewritewritelinesappendextendinsertreversesortcapitalizecasefoldcenterencodeendswithexpandtabsfindformatisalnumisalphaisasciiisdecimalisdigitisidentifierislowerisnumericisprintableisspaceistitleisupperjoinljustlowerlstripmaketranspartitionreplacerfindrindexrjustrpartitionrsplitrstripsplitsplitlinesstartswithstripswapcasetitletranslateupperdirzfillFunction Details: property
Description
Property attribute.
Extended Description
The property() function returns a property object. Properties are a way to manage attribute access in classes. They allow you to define methods that will be called when an attribute is accessed, set, or deleted. This provides a way to customize attribute behavior without changing the class interface. Properties can be used for data validation, computed attributes, or to make attributes read-only.
Read More about property from Python Documentation
Function Signature
property(fget: Optional[Callable] = None, fset: Optional[Callable] = None, fdel: Optional[Callable] = None, doc: Optional[str] = None) -> property
Module: builtins
Class: property
Parameters
Parameter List
- fget: Optional[Callable]
- fset: Optional[Callable]
- fdel: Optional[Callable]
- doc: Optional[str]
Return
Returns a property object that can be used as a decorator or assigned directly to a class attribute.
Return Type
property
Output
Explanation
This example demonstrates how to use properties for getter, setter, and computed attributes.