Message182238
| Author |
serhiy.storchaka |
| Recipients |
Arfrever, Jim.Jewett, Trundle, alex, asvetlov, barry, bfroehle, chris.jerdonek, daniel.urban, david.villa, dmalcolm, eric.smith, ezio.melotti, gregory.p.smith, gvanrossum, jcea, jkloth, larry, mark.dickinson, ncoghlan, pitrou, scoder, serhiy.storchaka, skrah, v+python |
| Date |
2013年02月16日.20:00:02 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1361044802.24.0.0277404633973.issue16612@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> { path: [string, bytes, int] => path_converter => path_t },
> *,
> { dir_fd: [int, None] = None => OS_STAT_DIR_FD_CONVERTER => int },
> { follow_symlinks: bool = True => "p" => int }
Why not just:
path: path_t
*
dir_fd: dir_fd_t = None => DEFAULT_DIR_FD
follow_symlinks: bool = True => 1
?
And register types somewhere:
clinic.register('path_t', restype='path_t', converter='path_converter', signature='[string, bytes, int]')
clinic.register('dir_fd_t', restype='int', converter='OS_STAT_DIR_FD_CONVERTER', signature='[int, None]')
clinic.register('bool', restype='int', converter='_PyBool_Converter', signature='bool')
...
clinic.register('string', restype='PyObject *', converter='_PyUnicode_Converter', signature='string')
clinic.register('buffer', restype='PyBuffer', converter='_PyBuffer_Converter', signature='buffer')
...
clinic.register('int', restype='int', converter='_Py_int_Converter', signature='int')
clinic.register('unsigned long', restype='unsigned long', converter='_Py_long_Converter', signature='int')
If you use path_converter, then definitely input types are [string, bytes, int] and an output C type is path_t. You need only name all converters and register them. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年02月16日 20:00:02 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, barry, gregory.p.smith, jcea, mark.dickinson, ncoghlan, pitrou, scoder, larry, eric.smith, jkloth, ezio.melotti, Arfrever, v+python, alex, Trundle, asvetlov, skrah, dmalcolm, daniel.urban, chris.jerdonek, Jim.Jewett, bfroehle, david.villa |
| 2013年02月16日 20:00:02 | serhiy.storchaka | set | messageid: <1361044802.24.0.0277404633973.issue16612@psf.upfronthosting.co.za> |
| 2013年02月16日 20:00:02 | serhiy.storchaka | link | issue16612 messages |
| 2013年02月16日 20:00:02 | serhiy.storchaka | create |
|