Menu

Clonable

Nicolas Hainaux
There is a newer version of this page. You can find it here.

All core objects are Clonables.

Method : (provided) clone()

The clone() method will create a new object having the same content as the original. Using clone() avoids bad surprises like loss of information when assigning or unwanted modifications happening after an assignation etc.

For instance, in __init__(), you'd better write :

self._field = arg.clone()

instead of :

self._field = arg

Back


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.