@@ -59,14 +59,21 @@ Py_ssize_t PyObject_Length(PyObject* o);
59
59
// / _
60
60
alias PyObject_Length PyObject_Size;
61
61
62
- /* * The length hint function returns a non-negative value from o.__len__()
63
- or o.__length_hint__(). If those methods aren't found or return a negative
64
- value, then the defaultvalue is returned. If one of the calls fails,
65
- this function returns -1.
66
- */
67
- version (Python_2_6_Or_Later){
62
+ version (Python_3_0_Or_Later) {
63
+ Py_ssize_t PyObject_LengthHint (PyObject* , Py_ssize_t);
64
+ }else version (Python_2_6_Or_Later){
65
+ /* * The length hint function returns a non-negative value from o.__len__()
66
+ or o.__length_hint__(). If those methods aren't found or return a negative
67
+ value, then the defaultvalue is returned. If one of the calls fails,
68
+ this function returns -1.
69
+ */
68
70
Py_ssize_t _PyObject_LengthHint (PyObject* , Py_ssize_t);
69
71
}else version (Python_2_5_Or_Later){
72
+ /* * The length hint function returns a non-negative value from o.__len__()
73
+ or o.__length_hint__(). If those methods aren't found or return a negative
74
+ value, then the defaultvalue is returned. If one of the calls fails,
75
+ this function returns -1.
76
+ */
70
77
Py_ssize_t _PyObject_LengthHint (PyObject* );
71
78
}
72
79
@@ -94,7 +101,7 @@ version(Python_2_6_Or_Later){
94
101
95
102
/* * Return 1 if the getbuffer function is available, otherwise
96
103
return 0 */
97
- int PyObject_CheckBuffer ()(PyObject* obj){
104
+ int PyObject_CheckBuffer ()(PyObject* obj) {
98
105
version (Python_3_0_Or_Later) {
99
106
return (obj.ob_type.tp_as_buffer ! is null ) &&
100
107
(obj.ob_type.tp_as_buffer.bf_getbuffer ! is null );
@@ -414,6 +421,7 @@ PyObject** PySequence_Fast_ITEMS()(PyObject* sf) {
414
421
}
415
422
// / _
416
423
Py_ssize_t PySequence_Count (PyObject* o, PyObject* value);
424
+
417
425
// / _
418
426
enum PY_ITERSEARCH_COUNT = 1 ;
419
427
// / _
@@ -492,9 +500,9 @@ int PyObject_IsInstance(PyObject* object, PyObject* typeorclass);
492
500
// / _
493
501
int PyObject_IsSubclass (PyObject* object, PyObject* typeorclass);
494
502
version (Python_2_6_Or_Later){
495
- // / Availability: >= 2.6
503
+ // / Availability: >= 2.6
496
504
int _PyObject_RealIsInstance (PyObject* inst, PyObject* cls);
497
- // / Availability: >= 2.6
505
+ // / Availability: >= 2.6
498
506
int _PyObject_RealIsSubclass (PyObject* derived, PyObject* cls);
499
507
}
500
508
0 commit comments