Use NoneType to represent the absence of a value
The
None object (of type NoneType) is used to initialize a variable when a value is not yet available but the variable must be defined. None is a singleton, meaning all variables assigned to None refer to the same object in memory. It is best practice to check for None using the is operator.produto = None
if produto is None:
produto = funcao_para_definicao_do_produto()
# Demonstrating singleton behavior
a = None
b = None
print(a is b) # True