4 ms·
OK, but in Python this isn't actually true... numbers are not passed any differently than other kinds of objects. As such, it does not have the same semantics a
by zephyrfalcon 8y ago
OK, but in Python this isn't actually true... numbers are not passed any differently than other kinds of objects. As such, it does not have the same semantics as Java, which does distinguish between primitives and non-primitives.
Of course, this kind of discussion isn't new to the Python community either. The actual calling convention is somewhere between call by value and call by reference, sometimes called "call by object". This is well worth reading: http://effbot.org/zone/call-by-object.htm http://effbot.org/zone/call-by-object.htm
- colanderman 8y agoNo, Java makes no such distinction in passing. Java does have values which are not object pointers, but, just like object pointers, they are passed by value, and behave exactly the same as an immutable object in either language.