metatype

S

shangyu

-----原始邮件-----
å‘件人: "shangyu" <[email protected]>
å‘é€æ—¶é—´: ‎2013/‎3/‎12 0:20
收件人: "(e-mail address removed)" <[email protected]>
主题: [Core-mentorship] metatype

Hi dear all,
I have following Python code
class mydict(dict):
def __init__(self):
pass
I wonder how this new type get created . What is the type of metatype in the following line ?
type = (PyTypeObject *)metatype->tp_alloc(metatype, nslots);
(line 2296 of typeobject.c Python2.7.3 source code)
It seems PyDict_Type . If so , how do I expect the tp_alloc will return a PyTypeObject object ? Maybe I've missed something ?
Many thanks!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,249
Latest member
KattieCort

Latest Threads

Top