Values and objects [was Re: Pass variable by reference]
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Wed May 7 21:08:02 EDT 2014
On Thu, 08 May 2014 00:22:55 +0300, Marko Rauhamaa wrote:
> But hey, we can open another thread for whether Python has values or
> objects!
In Python, all values *are* objects. It isn't a matter of choosing one or
the other. The value 1 is an object, not a native (low-level, unboxed) 32
or 64 bit int.
Unlike C# or Java, there is no direct language facility to box native
values into objects or unbox objects to native values.
But note that Python objects can encompass machine values. For example,
the array type is implemented as an array of native values, transparently
packing and unpacking the values as needed.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
More information about the Python-list
mailing list