Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
dwattttt
on Aug 13, 2024
|
parent
|
context
|
favorite
| on:
Go structs are copied on assignment (and other thi...
So to be very clear:
def foo(x): x['a'] = 1 y = {'b': 2} foo(y) print(y)
foo can modify the object y points to, but it can't make y point to a different object? Is that what "This is impossible in Python" is referring to?
tsimionescu
on Aug 13, 2024
[–]
Yes.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: