Debes tener cuidado al usar una copia superficial con objetos mutables.
You should be careful when using a shallow copy with mutable objects.
Detectar cambios en objetos mutables es difícil porque son modificados directamente.
Detecting changes in mutable objects is difficult because they are modified directly.
Esta detección requiere que los objetos mutables sean comparados a la copia previa del mismo y que el árbol entero del objeto sea recorrido.
This detection requires the mutable object to be compared to previous copies of itself and the entire object tree to be traversed.
inmutable Un objeto inmutable es aquél cuyo estado no se puede modificar después de su creación, en contraste con los objetos mutables, que se pueden modificar después de su creación.
immutable An immutable object is one whose state cannot be modified after creation, in contrast to a mutable object, which can be modified after creation.
Una copia profunda es esencial cuando se trabaja con objetos mutables en programación.
A deep copy is essential when working with mutable objects in programming.
En general, resulta más seguro evitar usar alias cuando se está trabajando con objetos mutables.
In general, it is safer to avoid aliasing when you are working with mutable objects.
En consecuencia, los objetos inmutables son considerados más seguros entre hilos que los objetos mutables.
Immutable objects are therefore considered more thread-safe than mutable objects.
El uso descuidado de las listas (y otros objetos mutables) puede ocasionar largas horas de depuración.
Careless use of lists (and other mutable objects) can lead to long hours of debugging.
Copiar objetos mediante referencias es más difícil cuando se hace sobre objetos mutables, ya que si cualquier referencia a un objeto mutable cambia el objeto referenciado, el resto de referencias al objeto verán dicho cambio.
The reference copying technique is much more difficult to use for mutable objects, because if any user of a mutable object reference changes it, all other users of that reference see the change.
Copiar objetos mediante referencias es más difícil cuando se hace sobre objetos mutables, ya que si cualquier referencia a un objeto mutable cambia el objeto referenciado, el resto de referencias al objeto verán dicho cambio.
The reference copying technique is much more difficult to use for mutable objects, because if any user of a reference to a mutable object changes it, all other users of that reference will see the change.
El patrón de diseño conocido como observer (observador) es una alternativa para controlar cambios sobre objetos mutables.
The observer pattern is an alternative technique for handling changes to mutable objects. Copy-on-write[edit]
No es posible asignar a los ítems individuales de una tupla, pero sin embargo sí se puede crear tuplas que contengan objetos mutables, como las listas.
It is also possible to create tuples which contain mutable objects, such as lists. To construct a tuple of one item (note the trailing comma is required)
Potentieel gevoelige of ongepaste informatie
Er worden alleen voorbeelden gegeven om u te helpen het woord of de woordcombinatie waarop u hebt gezocht, te vertalen. Deze worden niet door ons geselecteerd of gevalideerd en kunnen ongepaste taal bevatten. Wij vragen u melding te maken van voorbeelden die dienen te worden aangepast of verwijderd. Vertalingen met grof of informeel taalgebruik worden meestal rood of oranje gemarkeerd.