makeprop

Minor Version:

Overview

This projects allows you to easily create a simple property.

Installation
Features
  • class makeprop(var: Optional[str] = None)
  • class makeprop(var: Optional[str] = None, *, delete: object)

Usage:

from makeprop import makeprop

# Define a class and use makeprop to create a property
class Example:
    @makeprop()
    def value(self, x):
        """Square the value before storing it."""
        return x ** 2

# Use the property
example = Example()
example.value = 4
print(example.value)  # Output: 16
__call__(func: Callable) -> property
makeprop.test() -> unittest.TextTestRunner
License
Impressum