Skip to content

Commit

Permalink
NEW: added how to prevent shallow copies
Browse files Browse the repository at this point in the history
  • Loading branch information
joschaschmiedt committed Oct 14, 2019
1 parent 3070a20 commit 3741631
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/source/user/fieldtrip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ extent, we highlight here what we think are the most important differences:
>>> y
[-1, 2, 3, 4]

To prevent this an explicit copy of a `list`, `numpy.array`, etc. can be requested:

>>> x = [1, 2,3 ,4]
>>> y = list(x)
>>> x[0] = -1
>>> y
[1, 2, 3, 4]

* Python's powerful `import system <https://docs.python.org/3/reference/import.html>`_
allows simple function names (e.g., :func:`~syncopy.load`) without worrying
about overwriting built-in functions
Expand Down

0 comments on commit 3741631

Please sign in to comment.