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

lists coupled #41544

Closed
chopf mannequin opened this issue Feb 7, 2005 · 2 comments
Closed

lists coupled #41544

chopf mannequin opened this issue Feb 7, 2005 · 2 comments

Comments

@chopf
Copy link
Mannequin

chopf mannequin commented Feb 7, 2005

BPO 1118101
Nosy @tim-one

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2005-02-07.20:03:28.000>
created_at = <Date 2005-02-07.19:49:10.000>
labels = ['invalid']
title = 'lists coupled'
updated_at = <Date 2005-02-07.20:03:28.000>
user = 'https://bugs.python.org/chopf'

bugs.python.org fields:

activity = <Date 2005-02-07.20:03:28.000>
actor = 'tim.peters'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['None']
creation = <Date 2005-02-07.19:49:10.000>
creator = 'chopf'
dependencies = []
files = []
hgrepos = []
issue_num = 1118101
keywords = []
message_count = 2.0
messages = ['24191', '24192']
nosy_count = 2.0
nosy_names = ['tim.peters', 'chopf']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1118101'
versions = []

@chopf
Copy link
Mannequin Author

chopf mannequin commented Feb 7, 2005

is this normal?
>>> ================================ RESTART
================================
>>> k=[1,2]
>>> k
[1, 2]
>>> l=k
>>> l
[1, 2]
>>> l[0]='hello'
>>> l
['hello', 2]
>>> k
['hello', 2]

expected: [1,2]

@chopf chopf mannequin closed this as completed Feb 7, 2005
@chopf chopf mannequin added the invalid label Feb 7, 2005
@chopf chopf mannequin closed this as completed Feb 7, 2005
@chopf chopf mannequin added the invalid label Feb 7, 2005
@tim-one
Copy link
Member

tim-one commented Feb 7, 2005

Logged In: YES
user_id=31435

Yes, it's normal. You've given two names ("l" and "k") to a
single list object. This is fundamental to how Python works.
Maybe this will help:

http://effbot.org/zone/python-objects.htm

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
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