我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用uuid.setter()。
def date(self): """ Getter/setter for the date member. The setter can take a string or a :meth:`datetime.datetime` and will do the appropriate transformation. """ if self._date: return self._date return datetime.datetime.now().strftime('%Y-%m-%d')
def publish_timestamp(self): """ Getter/setter. The setter can take an integer (as an epoch timestamp) or a :class:`datetime.datetime`. instance. """ if self._publish_timestamp: return self._publish_timestamp return int(time.time())
def type(self): """Getter/setter The setter will verify that the given value is valid. """ return self._type