def optional ( self , value = None ) : # If there's no value, this is a getter if value is None : return this . _optional # Else, set the flag else : this . _optional = value and True or False
setting avariable to a boolean python
Optional
def optional(self, value = None):
		"""Optional

		Getter/Setter method for optional flag

		Args:
			value (bool): If set, the method is a setter

		Returns:
			bool | None
		"""

		# If there's no value, this is a getter
		if value is None:
			return this._optional

		# Else, set the flag
		else:
			this._optional = value and True or False