Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #41095
| 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 | <yushang@outlook.com> |
| 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 | <python-list@python.org> |
| From | shangyu <yushang@outlook.com> |
| 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 <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3209.1363040697.2939.python-list@python.org> (permalink) |
| 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 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
-----原始邮件-----
发件人: "shangyu" <yushang@outlook.com>
发送时间: 2013/3/12 0:20
收件人: "core-mentorship@python.org" <core-mentorship@python.org>
主题: [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!!!
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
metatype shangyu <yushang@outlook.com> - 2013-03-12 06:22 +0800
csiph-web