Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue1649190

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Adding support for _Bool to ctypes as c_bool
Type:Stage:
Components:Extension ModulesVersions:Python 2.6
process
Status:closedResolution:accepted
Dependencies:Superseder:
Assigned To: thellerNosy List: chmod007, loewis, theller
Priority:normalKeywords:patch

Created on2007-01-31 21:04 bychmod007, last changed2022-04-11 14:56 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
c_bool patch against r53606.diffchmod007,2007-01-31 21:04Patch relative to revision 53606
c_bool patch against r53623.diffchmod007,2007-02-02 00:35Patch relative to revision 53623 -- addressing thomas' review
Messages (6)
msg51825 -(view)Author: David Remahl (chmod007)Date: 2007-01-31 21:04
Adds support for the C99 _Bool type to ctypes. Requires struct patch that has already been accepted in the python 2.6 train.Updates ctypes C extension, ctypes __init__.py, ctypes documentation and ctypes tests.
msg51826 -(view)Author: Martin v. Löwis (loewis)*(Python committer)Date: 2007-01-31 22:05
Thomas, can you take a look?I think this needs to take into account Python versions without bool support in the struct module, as the same ctypes code is used with older Python releases as well.
msg51827 -(view)Author: David Remahl (chmod007)Date: 2007-02-01 15:50
Should I prepare the patch relative to /ctypes/trunk/ctypes instead?
msg51828 -(view)Author: Thomas Heller (theller)*(Python committer)Date: 2007-02-01 20:22
David, I encountered these issues with the patch:1. a typo inLib/ctypes/test/test_numbers.py:   'bool_type' should be 'bool_types'   It is trivial to fix this.2. ctypes/__init__.py should be cean for 'from ctypes import *',   but with your patch it exposes the 'struct_error' symbol.   I would recommend to changeModules/_ctypes/cfield.c so that a   c_bool type can be created even if HAVE_C99_BOOL is undefined (I think   you took that approach in your _Bool struct patch).   Then, ctypes/__init__.py would not have to depend on the struct 't'   typecode at all.  The '_check_size(c_bool, "t")' check can probably be   removed.3. ctypes/test/test_repr.py does not work.   Easy to fix this: just add c_bool to the list of types starting   at line 5.These changes would also ensure compatibility with previous Pythonversions, with one exception: A check for the _Bool type must be addedtoModules/ctypes/libffi/configure.in.To answer your question: No, it is not needed to prepare a patchrelative to ctypes/trunk/ctypes.  This repository containssvn:external properties for the 'source' and 'ctypes' directories thatpoint into the 'release25-maint/Modules/_ctypes' and'release25-maint/Lib/ctypes' directories from Python.
msg51829 -(view)Author: David Remahl (chmod007)Date: 2007-02-02 00:35
Thanks for the review, Thomas! I've attached a new patch that addresses the points you bring up (I hope) in the suggested manner. I have not tested it on 2.5, but tests pass on 2.6.File Added: c_bool patch againstr53623.diff
msg51830 -(view)Author: Thomas Heller (theller)*(Python committer)Date: 2007-03-13 20:45
Committed asrevision 54357.  Thanks for the patch.
History
DateUserActionArgs
2022-04-11 14:56:22adminsetgithub: 44534
2007-01-31 21:04:22chmod007create
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp