Property Decorators Config

Console Output
>

Property Decorators Visualization

Current Configuration:
Class: BankAccount
Property: balance
Type: read_write
Validation: positive
Operation: create
Value: 1000
Property Type:
Read Write Property
@property decorator implementation
Getter and setter with validation
Property Decorators Structure:
@propertyGetter
@balance.setterSetter
@property (computed)Computed
Validation Rules:
Positive Validation
Only positive numbers allowed
Applied in @balance.setter method
Property Decorator Benefits:
Controlled access to private attributes
Automatic validation on assignment
Computed values without method calls
Clean API - access like regular attributes
Encapsulation without getter/setter methods
Operation Status:
Object Created
Instance of BankAccount with property decorators created
Generated Code Structure:
class BankAccount:
def __init__(self):
self._balance = 1000
@property
def balance(self):
return self._balance
@balance.setter
def balance(self, value):
if value < 0:
raise ValueError("balance cannot be negative")
self._balance = value
Usage Examples:
Get value: obj.balance
Set value: obj.balance = new_value
Direct access (not recommended): obj._balance
Property decorators make attributes look like regular attributes while providing controlled access