1+ # Licensed to the Apache Software Foundation (ASF) under one
2+ # or more contributor license agreements. See the NOTICE file
3+ # distributed with this work for additional information
4+ # regarding copyright ownership. The ASF licenses this file
5+ # to you under the Apache License, Version 2.0 (the
6+ # "License"); you may not use this file except in compliance
7+ # with the License. You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing,
12+ # software distributed under the License is distributed on an
13+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ # KIND, either express or implied. See the License for the
15+ # specific language governing permissions and limitations
16+ # under the License.
17+
118import _cython_3_0_10
219import enum
320import types
@@ -231,13 +248,17 @@ class CBuffer:
231248 def empty (* args , ** kwargs ): ...
232249 @staticmethod
233250 def from_pybuffer (* args , ** kwargs ): ...
251+ def __buffer__ (self , * args , ** kwargs ):
252+ """Return a buffer object that exposes the underlying memory of the object."""
234253 def __getitem__ (self , index ):
235254 """Return self[key]."""
236255 def __iter__ (self ):
237256 """Implement iter(self)."""
238257 def __len__ (self ) -> int :
239258 """Return len(self)."""
240259 def __reduce__ (self ): ...
260+ def __release_buffer__ (self , * args , ** kwargs ):
261+ """Release the buffer object that exposes the underlying memory of the object."""
241262
242263class CBufferBuilder :
243264 __pyx_vtable__ : ClassVar [PyCapsule ] = ...
@@ -289,7 +310,11 @@ class CBufferBuilder:
289310
290311 This method returns the number of elements that were written.
291312 """
313+ def __buffer__ (self , * args , ** kwargs ):
314+ """Return a buffer object that exposes the underlying memory of the object."""
292315 def __reduce__ (self ): ...
316+ def __release_buffer__ (self , * args , ** kwargs ):
317+ """Release the buffer object that exposes the underlying memory of the object."""
293318
294319class CBufferView :
295320 __pyx_vtable__ : ClassVar [PyCapsule ] = ...
@@ -310,13 +335,17 @@ class CBufferView:
310335 def elements (self , * args , ** kwargs ): ...
311336 def unpack_bits (self , * args , ** kwargs ): ...
312337 def unpack_bits_into (self , * args , ** kwargs ): ...
338+ def __buffer__ (self , * args , ** kwargs ):
339+ """Return a buffer object that exposes the underlying memory of the object."""
313340 def __getitem__ (self , index ):
314341 """Return self[key]."""
315342 def __iter__ (self ):
316343 """Implement iter(self)."""
317344 def __len__ (self ) -> int :
318345 """Return len(self)."""
319346 def __reduce__ (self ): ...
347+ def __release_buffer__ (self , * args , ** kwargs ):
348+ """Release the buffer object that exposes the underlying memory of the object."""
320349
321350class CDeviceArray :
322351 array : Incomplete
@@ -521,7 +550,7 @@ class SchemaMetadata:
521550 def keys (self , * args , ** kwargs ): ...
522551 def values (self , * args , ** kwargs ): ...
523552 def __contains__ (self , other ) -> bool :
524- """Return key in self."""
553+ """Return bool( key in self) ."""
525554 def __getitem__ (self , index ):
526555 """Return self[key]."""
527556 def __iter__ (self ):
0 commit comments