From c95d4a87e0609854388edf929d61ad46232d596e Mon Sep 17 00:00:00 2001 From: Aditya Singh Date: Sat, 7 Mar 2026 15:49:08 +0530 Subject: [PATCH] fix(curriculum): add brief explanation for decorators in getters and setters lesson (#65888) Co-authored-by: Dario <105294544+Dario-DC@users.noreply.github.com> --- .../68c128cbd77e4ba9ed671937.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/blocks/lecture-understanding-object-oriented-programming-and-encapsulation/68c128cbd77e4ba9ed671937.md b/curriculum/challenges/english/blocks/lecture-understanding-object-oriented-programming-and-encapsulation/68c128cbd77e4ba9ed671937.md index f6b216d949b..933c76bafbb 100644 --- a/curriculum/challenges/english/blocks/lecture-understanding-object-oriented-programming-and-encapsulation/68c128cbd77e4ba9ed671937.md +++ b/curriculum/challenges/english/blocks/lecture-understanding-object-oriented-programming-and-encapsulation/68c128cbd77e4ba9ed671937.md @@ -21,7 +21,9 @@ When you use a method, you always have to call it with parentheses. But with a p For example, you might want to calculate a value or check that a new value is valid before saving it. Instead of calling a method for that, you can use an attribute-like way to do that. -To create a property, you define a method and place the `@property` decorator above it. This tells Python to treat the method as a property. +In Python, a decorator is a function that modifies the functionalities of other functions, or classes, without changing their original code. + +While it is possible to create custom decorators, this is beyond the scope of this lesson. Just know that to create a property, you define a method and place the `@property` decorator above it. This turns the method into a property, so it can be accessed like an attribute while internally calling the decorated method. That takes us to getters. Here's how to create one with the `@property` decorator: