[Python-Dev] ANSI strict aliasing and Python

Martin v. Löwis martin@v.loewis.de
18 Jul 2003 19:04:28 +0200


Neil Schemenauer <nas-python@python.ca> writes:

> > The compiler could not use this optimization if we had
> > 
> > struct _dictobject {
> > 	PyObject _o;
> > 	int ma_fill;
> > 	int ma_used;
> > 	int ma_mask;
> > 	PyDictEntry *ma_table;
> > 	PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, long hash);
> > 	PyDictEntry ma_smalltable[PyDict_MINSIZE];
> > };
> 
> That's what I suspected.  If Python 3 was implemented using ANSI C, how
> would you suggest we implement objects?

Maybe I was not clear enough: The above *is* ANSI C, and that's what I
would use.

Regards,
Martin