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

copying and references #96

Open
procho opened this issue Nov 2, 2017 · 0 comments
Open

copying and references #96

procho opened this issue Nov 2, 2017 · 0 comments

Comments

@procho
Copy link
Collaborator

procho commented Nov 2, 2017

a = b makes a copy if strings
a = b copies the reference if lists

(Pdb) ii = [['1003 GPVR_L0003A_1 GS-MT-01', '3570.688']]
(Pdb) iii = ii[0]
(Pdb) iii
['1003 GPVR_L0003A_1 GS-MT-01', '3570.688']
(Pdb) aa = iii[0]
(Pdb) a = 'booo'
(Pdb) iii
['1003 GPVR_L0003A_1 GS-MT-01', '3570.688']
(Pdb) ii
[['1003 GPVR_L0003A_1 GS-MT-01', '3570.688']]
(Pdb) aa = 'boo'
(Pdb) ii
[['1003 GPVR_L0003A_1 GS-MT-01', '3570.688']]
(Pdb) iii
['1003 GPVR_L0003A_1 GS-MT-01', '3570.688']
(Pdb) iii[0] = 'boo'
(Pdb) ii
[['boo', '3570.688']]
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

1 participant