Python is ALWAYS pbref.
— list/arrayList, dict/HM etc: same behavior between java and py —
pbref. Edits by the function hits the original object.
— string: probably identical behavior between java and py —
immutable in both java and py.
Passed by reference in both.
If function “modifies” the string content, it gets a new string object (like copy-on-write), unrelated to the original string object in the “upstairs” stackframe.
— ints, floats etc: functionally similar between java and py —
If function modifies the integer content, the effect is “similar”. In python a new int object is created (like string). In java this int is a mutable clone of the original, created on the stackframe.
Java int is primitive, without usable address and pbclone, never pbref.
Python numbers are like python strings – immutable objects passed by reference. Probably copy-on-write.