Skip to content

copying and references #96

@procho

Description

@procho

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']]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions