This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2009年01月13日 17:54 by stutzbach, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (8) | |||
|---|---|---|---|
| msg79755 - (view) | Author: Daniel Stutzbach (stutzbach) (Python committer) | Date: 2009年01月13日 17:54 | |
The PyTypeObject field "tp_version_tag" (new in 2.6) isn't documented. "tp_del" isn't documented either. I'm not sure when it was added. |
|||
| msg112148 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年07月31日 12:23 | |
I think the reason tp_del isn't documented is that, as we somehow learnt it with the new IO code, it isn't really meant for third-party types. I would suggest checking with python-dev. As for tp_version_tag, it's for internal use (it indicated whether the method cache is still fresh), I don't think extension authors should modify it. |
|||
| msg180383 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2013年01月22日 13:00 | |
tp_cache and tp_weaklist are also for internal use only, but are documented. One reason for documenting them is that users will run into them when running with a high enough warning level in GCC. |
|||
| msg180474 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年01月23日 16:59 | |
> tp_cache and tp_weaklist are also for internal use only, but are > documented. Ok, so I guess tp_version_tag and tp_del should also be documented as "for internal use only". |
|||
| msg187450 - (view) | Author: Alex Leach (Alex.Leach) | Date: 2013年04月20日 18:32 | |
I've just ran into tp_version_tag, when running the boost python testsuite and wondered what it was... Since upgrading to GCC 4.8, I've started to get a lot more warnings with Python extensions, e.g.:- boost/python/opaque_pointer_converter.hpp:122:14: warning: missing initializer for member ‘_typeobject::tp_version_tag’ [-Wmissing-field-initializers] In this instance the testsuite was made to compile with the '-Wextra' flag. The fix was pretty simple; add another zero to the opaque_pointer_convert struct. I have used the following preprocessor macro to test whether or not to do this. Would this be a good way to test for the addition? #if PY_VERSION_HEX >= 0x02060000 0, /* tp_version_tag */ #endif Cheers, Alex |
|||
| msg316433 - (view) | Author: book book (book book) | Date: 2018年05月12日 18:09 | |
tp_del still undocumented. In my opinion, tp_del corresponds to the __del__() method of classes, because there are no other variable correspondes to it, but methods using for creating(tp_new) and initializing(tp_init) an object are not. Although __del__ method have some issue according to the offical document, but it is exist, so there must have a pointer to the function corresponding to it. |
|||
| msg316434 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2018年05月12日 18:12 | |
The reason tp_del has remained undocumented is that it's now obsolete. You should use tp_finalize instead: https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_finalize tp_finalize is roughly the C equivalent of __del__ (tp_del was something else, despite the name). |
|||
| msg316435 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2018年05月12日 18:13 | |
Both tp_del and tp_version_tag are for internal use. Besides, tp_del is obsolete as I mentioned above. So I'm going to close the issue. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:44 | admin | set | github: 49184 |
| 2018年05月12日 18:13:26 | pitrou | set | status: open -> closed resolution: not a bug messages: + msg316435 stage: resolved |
| 2018年05月12日 18:12:40 | pitrou | set | messages:
+ msg316434 versions: + Python 3.7, Python 3.8 |
| 2018年05月12日 18:09:03 | book book | set | nosy:
+ book book messages: + msg316433 versions: + Python 3.6, - Python 2.6, Python 2.7, Python 3.2, Python 3.3, Python 3.4 |
| 2013年04月20日 18:32:39 | Alex.Leach | set | nosy:
+ Alex.Leach messages: + msg187450 |
| 2013年01月23日 16:59:21 | pitrou | set | messages: + msg180474 |
| 2013年01月22日 13:04:25 | ezio.melotti | set | type: enhancement versions: + Python 3.3, Python 3.4, - Python 3.1 |
| 2013年01月22日 13:00:40 | ronaldoussoren | set | nosy:
+ ronaldoussoren messages: + msg180383 |
| 2011年05月19日 08:25:09 | gagern | set | nosy:
+ gagern |
| 2010年07月31日 12:24:20 | pitrou | set | nosy:
+ benjamin.peterson |
| 2010年07月31日 12:23:38 | pitrou | set | nosy:
+ pitrou messages: + msg112148 |
| 2010年07月31日 11:37:07 | BreamoreBoy | set | assignee: georg.brandl -> docs@python nosy: + docs@python versions: + Python 3.2, - Python 3.0 |
| 2009年01月13日 17:54:44 | stutzbach | create | |