WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2026 Poal.co

654

There is no pass by reference at all in Python. You get a variable or an object. You TOTALLY CAN (can not) modify ab object in the function you're passing it to. Issue is: modifying an object is NOT pass by reference. Modifying memory is pass by reference. THAT IS WHAT REFERENCE MEANS. So no, I can't pass my function a list x, expand the list into any number of lists, and have X now be that sequence of lists. I have to wrap all of those lists together into a nested list, making the entire idea useless.

There is no pass by reference at all in Python. You get a variable or an object. You TOTALLY CAN (can not) modify ab object in the function you're passing it to. Issue is: modifying an object is NOT pass by reference. Modifying memory is pass by reference. THAT IS WHAT REFERENCE MEANS. So no, I can't pass my function a list x, expand the list into any number of lists, and have X now be that sequence of lists. I have to wrap all of those lists together into a nested list, making the entire idea useless.

(post is archived)

[–] 1 pt

Why are you hurting yourself?

[–] 0 pt

You can modify objects passed to a function. I've written plenty of functions that take a list or dict as a parameter and return nothing. The reference to the object passed in allows you to modify that object.

[–] 0 pt

Yes, you can. But I want to pass the function... say this; for chunk in my_dict: if chunk ........... : for nigger in chunk: if nigger . ... : this_function(nigger)

Now, that works. I can modify that list segment in the function perfectly fine and the parent list, outside the function ,sees the modification.

my_dict = ['1', ['2', ['3', '4', '5']]]

So nigger = ['3', '4', '5'] I modify it in this_function, but I can't make it '3', '4', '5' without wrapping that in a list, and that's retarded as fuck. I want it to be able to end up as my_dict = ['1', ['2', '3', '4', '5']]

[–] 1 pt

But that's a list, and you named it my_dict.