cinap_lenrekadd hg and python4bb9e2215 years agoHistory
2550 lines · 57.3 KB · C
RawDownload
 static PyMethodDef module_methods[] = {	{"tee",	(PyCFunction)tee,	METH_VARARGS, tee_doc}, 	{NULL,		NULL}		/* sentinel */}; PyMODINIT_FUNCinititertools(void){	int i;	PyObject *m;	char *name;	PyTypeObject *typelist[] = {		&cycle_type,		&dropwhile_type,		&takewhile_type,		&islice_type,		&starmap_type,		&imap_type,		&chain_type,		&ifilter_type,		&ifilterfalse_type,		&count_type,		&izip_type,		&repeat_type,		&groupby_type,		NULL	}; 	teedataobject_type.ob_type = &PyType_Type;	m = Py_InitModule3("itertools", module_methods, module_doc);	if (m == NULL)		return; 	for (i=0 ; typelist[i] != NULL ; i++) {		if (PyType_Ready(typelist[i]) < 0)			return;		name = strchr(typelist[i]->tp_name, '.');		assert (name != NULL);		Py_INCREF(typelist[i]);		PyModule_AddObject(m, name+1, (PyObject *)typelist[i]);	} 	if (PyType_Ready(&teedataobject_type) < 0)		return;	if (PyType_Ready(&tee_type) < 0)		return;	if (PyType_Ready(&_grouper_type) < 0)		return;}

Lines 2501–2550 of 2550. Previous lines