# प्रॉपर्टीज़ और एनकैप्सुलेशन — Python Fundamentals: Basics से Async तक

Source: https://www.skillbyai.com/hi/python/py-properties-encapsulation

> Underscore conventions और @property getters से attribute access नियंत्रित करें जो validation सुरक्षित रूप से जोड़ते हैं।

## नामकरण परंपराएँ

पायथन में कोई असली `private` कीवर्ड नहीं है। शुरुआती अंडरस्कोर `_name` परंपरा से "आंतरिक, न छुएँ" संकेत देता है।

## @property

`@property` किसी मेथड को एट्रिब्यूट जैसा गेटर बना देता है, जिससे बिना कॉल करने वालों का तरीका बदले validation जोड़ी जा सकती है।

```python
class Circle:
    def __init__(self, radius):
        self._radius = radius

    @property
    def area(self):
        return 3.14159 * self._radius ** 2

c = Circle(4)
print(c.area)   # 50.265... -- called like an attribute, no ()
```
