Over 30 types of variables available in python ?

Chris Angelico rosuav at gmail.com
Mon Jan 7 15:59:52 CET 2013


On Tue, Jan 8, 2013 at 1:45 AM, Dave Angel <d at davea.name> wrote:
> On 01/07/2013 09:32 AM, marduk wrote:
>> So I guess if one *really* wanted to compare C variables to Python
>> variables, you could say that all python variables are of type void*
>> except Python does all mallocs/frees and the casting for you.
>
> A better analogy would be to C++, and all names would be something like
> shared_ptr<object*>.  And (except for old-style classes) all actual data
> is of a type derived from object.

But yes, a C pointer variable is closest to a Python local, with
actual content always stored on the heap.

ChrisA



More information about the Python-list mailing list