Property in Python (#1660)

hi

Could you implement properties in python as stereotype in class diagrams?

and notably in the code generation:

class House:

def __init__(self, price):

self._price = price

@property

def price(self):

return self._price

@price.setter

def price(self, new_price):

if new_price > 0 and isinstance(new_price, float):

self._price = new_price

else:

print("Please enter a valid price")

Cordialy

Created
4 December 2020 18:39:16
Closed
8 December 2020 8:10:47
Requested by
fr016
State
Solved
Version
12.83
OperatingSystem
win x64
Solved in
12.84

Dusan Rodina - softwareideas.net 4 December 2020 23:04:58

Hi,

It should be available in the next release.

TrackedRequestComment
Your Name:
You can use these formatting tags: [b]bold[/b] [i]italic[/i] [u]underline[/u] [url]www.example.com[/url] [code]some code[/code] [quote]quoted text[/quote] [list]one list item per line[/list]