Skip to content

Instantly share code, notes, and snippets.

@liladas
Last active March 21, 2020 04:26
Show Gist options
  • Save liladas/bd9e79d0cc78fb9608529c6dc00110a5 to your computer and use it in GitHub Desktop.
Save liladas/bd9e79d0cc78fb9608529c6dc00110a5 to your computer and use it in GitHub Desktop.
Python Property Verbose
class PurchaseOrder():
""" PurchaseOrder - Models a Purchase made from market """
def __init__(self, order_id: string):
super().__init__()
self._order_id = order_id
# defining a property
def order_id():
doc = "The order_id property."
def fget(self):
return self._order_id
def fset(self, value):
self._order_id = value
def fdel(self):
del self._order_id
return locals()
order_id = property(**order_id())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment