Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.073 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; 'missed': 0.09; 'python': 0.09; 'def': 0.10; '(line': 0.16; 'email addr:python.org"': 0.16; 'thanks!!!': 0.16; 'all,': 0.21; "i've": 0.23; 'seems': 0.23; 'pass': 0.25; 'skip:[ 10': 0.26; 'wonder': 0.27; 'skip:_ 10': 0.29; 'source': 0.29; 'class': 0.29; 'maybe': 0.29; 'expect': 0.31; 'code': 0.31; 'to:addr:python-list': 0.33; 'skip:- 20': 0.34; 'something': 0.35; 'created': 0.36; 'email addr:python.org': 0.36; 'object': 0.38; 'to:addr:python.org': 0.39; '8bit%:50': 0.65; 'skip:\xe5 10': 0.65; 'dear': 0.66; 'skip:\xe2 10': 0.66; '8bit%:92': 0.70; 'pytypeobject': 0.84; '8bit%:55': 0.93 X-EIP: [JJ8/eNdM4EaVCVRWKF3juJ45CnQkRl7n] X-Originating-Email: [yushang@outlook.com] MIME-Version: 1.0 To: From: shangyu Subject: metatype Date: Tue, 12 Mar 2013 06:22:24 +0800 Importance: normal X-Priority: 3 Content-Type: multipart/alternative; boundary="_C75C44AB-A25E-4D6A-9E94-B8DDDB5448A8_" X-OriginalArrivalTime: 11 Mar 2013 22:23:48.0246 (UTC) FILETIME=[19DABB60:01CE1EA7] X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 85 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363040697 news.xs4all.nl 6943 [2001:888:2000:d::a6]:57884 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41095 --_C75C44AB-A25E-4D6A-9E94-B8DDDB5448A8_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" -----=E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6----- =E5=8F=91=E4=BB=B6=E4=BA=BA: "shangyu" =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: =E2=80=8E2013/=E2=80=8E3/=E2=80=8E12 = 0:20 =E6=94=B6=E4=BB=B6=E4=BA=BA: "core-mentorship@python.org" =E4=B8=BB=E9=A2=98: [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 th= e following line ? type =3D (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 P= yTypeObject object ? Maybe I've missed something ? Many thanks!!!= --_C75C44AB-A25E-4D6A-9E94-B8DDDB5448A8_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

=E5=8F=91=E4=BB=B6=E4=BA=BA: s= hangyu
=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: = =E2=80=8E2= 013/=E2=80=8E3/=E2=80=8E12 0:20
=E6=94=B6=E4=BB=B6=E4=BA= =BA: core-mentorship@python.org<= /A>
=E4=B8=BB=E9=A2=98: [Core-mentorship] metatype
Hi dear all,=20
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 =3D (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!!!

= --_C75C44AB-A25E-4D6A-9E94-B8DDDB5448A8_--