Field replacement in Namedtuple
Namedtuple, being a motorcade, is an unchanged type. However, the _replace method returns a new object in which selected fields are edited, and all the others are equal to the values from the previous motorcade.
⚠️ Replace method makes a surface copy of the data, that is, copies links. If everything will be in order with lines and numbers (they are copied), then the link to the list will be divided between both objects.
Documentation Namedtuple
There is an opportunity to provide the class itself and its fields with documentation (DOC-STRINGS):
Type HELP (Book) in the interpreter and you will see that Book now has a description of the class and all fields. As well as by default, Namedtuple adds a bunch of standard documentation according to class methods. Example code:
#machinelearning #articalIlinTelling #ai #DatAscence #PROGRAMMMING #TECHNOLOGY #DEEPLEARNING #Programming