Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy() seems to behave as deepcopy() in IJulia notebook #1093

Open
weikou opened this issue Sep 1, 2023 · 2 comments
Open

copy() seems to behave as deepcopy() in IJulia notebook #1093

weikou opened this issue Sep 1, 2023 · 2 comments

Comments

@weikou
Copy link

weikou commented Sep 1, 2023

Hi,

I found a confusing inconsistency between the julia REPL and IJulia notebook.

When I open an IJulia notebook and type in

a = [[1,2,3],[4,5,6]]
b = copy(a)
a[1][1] = 11
b

b does not change (in the IJulia notebook). So, copy() acts the same as deepcopy() here.
However, in the normal Julia REPL, as copy() is not recursive, so b[1][1] is changed to 11.

I am using:
Julia Version 1.8.1
Commit afb6c60d69a (2022-09-06 15:09 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 4 × Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, ivybridge)
Threads: 1 on 4 virtual cores

My package version of IJulia is: IJulia v1.24.2

@fredrikekre
Copy link
Member

I can't reproduce this issue. What version of IJulia are you using? Does it happen in a fresh notebook with no packages loaded?

@weikou
Copy link
Author

weikou commented Sep 5, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants