Python is just as good as C++ for real apps

Grant Edwards grante at visi.com
Fri Jan 25 19:50:35 EST 2002


In article <8tu35uk9uvgsvs79lekrfgvm5vj6gbbevn at 4ax.com>, Courageous wrote:
> 
>>Think of it as meaning that *p is of type int rathing than p is
>>of type int*, and then it makes a bit more sense.
> 
> Only in that context. In other contexts, thinking of it that
> way is nonsensical. For example, when you do ++, tell me how much
> is added to it again?

I'm not sure what the referrent of "it" is, but assuming it's
*p, then incrementing it adds one to it and sizeof *p is the
same as sizeof (int) -- which is 4 on all of my boxes.  IOW, *p
behaves like any other int.

> How about sizeof?. int* doesn't _behave_
> like an int. It behaves like a pointer, which so happens can be
> safely and without-casting be evaluated to an int.

Eh?  (*p) behaves like an int:

int   i;  // means "i" is an int
int  *p;  // means that "*p" is an int

> *shrug*
> 
> It's not like it's a big deal, really. 

No, but I'm confused about why you say thinking about *p as an
int is nonsensical...

> And I understand that there
> was a requirement for backward comparability with C.


-- 
Grant Edwards                   grante             Yow!  My vaseline is
                                  at               RUNNING...
                               visi.com            



More information about the Python-list mailing list