Skip to content

Commit

Permalink
Add a cautionary note for mutable data
Browse files Browse the repository at this point in the history
  • Loading branch information
toru4838 committed Nov 22, 2023
1 parent 48727d9 commit 5b539cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/core/quri_parts/core/utils/recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ def recordable(f: Callable[Concatenate["Recorder", P], R]) -> RecordableFunction
does not need to pass a :class:`Recorder` instance. This decorator
also adds a :class:`RecordableFunctionId`, which can be accesed via
:attr:`id` attribute.
Note that when you store mutable data such as list, `RecordEntry`
does not store the snapshot of the data. This means that the data
you get is the latest one when you access it. If you want to get
the snapshot of the data, you need to copy it by yourself.
"""
# Currently `param` is an empty tuple. But we may add support for it in the future.
param = ()
Expand Down

0 comments on commit 5b539cf

Please sign in to comment.