c - How can we shift ob_item pointer in Python tuple if it is static array? -


i reading python 2.7 source code , got stuck following piece of code, in tupleobject.h:

pyobject *ob_item[1]; 

and in tupleobject.c (pytuple_setitem):

p = ((pytupleobject *)op)->ob_item + i; 

how can shift pointer i if ob_item array of 1 pyobject?

it's how arrays , pointers can used interchangeable. it's equivalent to

p = &((pytupleobject *)op)->ob_item[i]; 

is array name pointer? goes little more detail.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -