Skip to content

Instantly share code, notes, and snippets.

@liladas

liladas/purchase_order.py

Last active Mar 21, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.