Changes between Version 3 and Version 4 of Ticket #30302, comment 21


Ignore:
Timestamp:
08/07/20 16:03:59 (2 years ago)
Author:
gh-mjungmath
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30302, comment 21

    v3 v4  
    1919I just overread this tiny but important part.
    2020
    21 What about simply making those `Components` immutable which are bound to tensors? Similar as my proposal in comment:19. Each time the components of a tensor are changed via `set_comp` or `add_comp`, a whole new `Component` is created from scratch (`self._new_comp` is invoked). Making those components immutable which are used for tensors, wouldn't change much. Then we don't have to copy whole `Components` anymore.
     21What about simply making those `Components` immutable which are bound to tensors? Similar as my proposal in comment:19. Each time the components of a tensor are changed via `set_comp` or `add_comp`, a whole new `Component` is created from scratch (`self._new_comp` is invoked). Making those components immutable which are used for tensors, wouldn't change much. Then we don't have to copy whole `Components` anymore, but only the dictionaries.