Staging
v0.5.1
https://github.com/python/cpython
Revision 965f323f86661c17571fc12ebd454dc56c28e0e0 authored by Peter Astrand on 23 September 2005, 17:42:36 UTC, committed by Peter Astrand on 23 September 2005, 17:42:36 UTC
* Added note about Python 2.2 compatibility.

* Changed license header: Now simply referring to PSF. This closes bug
  1138653.
1 parent b21d81e
Raw File
Tip revision: 965f323f86661c17571fc12ebd454dc56c28e0e0 authored by Peter Astrand on 23 September 2005, 17:42:36 UTC
Changed header to match the HEAD version:
Tip revision: 965f323
setobject.h

/* Set object interface */

#ifndef Py_SETOBJECT_H
#define Py_SETOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

/*
This data structure is shared by set and frozenset objects.
*/

typedef struct {
	PyObject_HEAD
	PyObject *data;
	long hash;	/* only used by frozenset objects */
	PyObject *weakreflist; /* List of weak references */

	/* Invariants:
	 *     data is a dictionary whose values are all True.
	 *     data points to the same dict for the whole life of the set.
	 * For frozensets only:
	 *     data is immutable.
	 *     hash is the hash of the frozenset or -1 if not computed yet.
	 */
} PySetObject;

PyAPI_DATA(PyTypeObject) PySet_Type;
PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;

#define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type)
#define PyAnySet_Check(ob) \
	((ob)->ob_type == &PySet_Type || (ob)->ob_type == &PyFrozenSet_Type || \
	  PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \
	  PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type))

#ifdef __cplusplus
}
#endif
#endif /* !Py_SETOBJECT_H */
back to top