Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

dataclass default list

@dataclass
class Pizza():
    ingredients: List = field(default_factory=lambda: ['dow', 'tomatoes'])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dataclass #default #list
ADD COMMENT
Topic
Name
2+5 =