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

Python 3.4 bugs #68651

Closed
vasyayugov mannequin opened this issue Jun 18, 2015 · 2 comments
Closed

Python 3.4 bugs #68651

vasyayugov mannequin opened this issue Jun 18, 2015 · 2 comments
Labels
OS-mac type-bug An unexpected behavior, bug, or error

Comments

@vasyayugov
Copy link
Mannequin

vasyayugov mannequin commented Jun 18, 2015

BPO 24463
Nosy @smontanaro, @ronaldoussoren, @ned-deily

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 2015-06-18.11:29:20.243>
created_at = <Date 2015-06-18.11:01:13.014>
labels = ['OS-mac', 'type-bug', 'invalid']
title = 'Python 3.4 bugs'
updated_at = <Date 2015-06-18.11:29:20.221>
user = 'https://bugs.python.org/vasyayugov'

bugs.python.org fields:

activity = <Date 2015-06-18.11:29:20.221>
actor = 'skip.montanaro'
assignee = 'none'
closed = True
closed_date = <Date 2015-06-18.11:29:20.243>
closer = 'skip.montanaro'
components = ['macOS']
creation = <Date 2015-06-18.11:01:13.014>
creator = 'vasya yugov'
dependencies = []
files = []
hgrepos = []
issue_num = 24463
keywords = []
message_count = 2.0
messages = ['245460', '245462']
nosy_count = 4.0
nosy_names = ['skip.montanaro', 'ronaldoussoren', 'ned.deily', 'vasya yugov']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue24463'
versions = ['Python 3.4']

@vasyayugov
Copy link
Mannequin Author

vasyayugov mannequin commented Jun 18, 2015

This code:

w = [[0] * 2] * 2
w[1][1] = 1
print(w)

prints
[[0, 1], [0, 1]]
Is it a bug?

@vasyayugov vasyayugov mannequin added OS-mac type-bug An unexpected behavior, bug, or error labels Jun 18, 2015
@smontanaro
Copy link
Contributor

Not a bug. The two elements of w are references to the same list:

>>> w = [[0] * 2] * 2
>>> w
[[0, 0], [0, 0]]
>>> [id(elt) for elt in w]
[21743952, 21743952]

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-mac type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant