Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
constantcrying
on Dec 19, 2024
|
parent
|
context
|
favorite
| on:
Borrow Checking, RC, GC, and Eleven Other Memory S...
It works the moment you wrap the int in a class.
class A:
a = 0
def modify (v):
v.a = 2
a1 = A()
a1.a = 1
print(a1.a)
modify(a1)
print(a1.a)
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
class A:
def modify (v): a1 = A()a1.a = 1
print(a1.a)
modify(a1)
print(a1.a)