Skip to content

Commit a40175e

Browse files
committed
_convert: add type hints
Because of the underscore, _convert is (correctly) not part of the external API, so this is for internal typechecking purposes only. The .pyi file will still be installed though. Signed-off-by: Benjamin Gilbert <[email protected]>
1 parent 0ca2cb6 commit a40175e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

openslide/_convert.pyi

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# openslide-python - Python bindings for the OpenSlide library
3+
#
4+
# Copyright (c) 2024 Benjamin Gilbert
5+
#
6+
# This library is free software; you can redistribute it and/or modify it
7+
# under the terms of version 2.1 of the GNU Lesser General Public License
8+
# as published by the Free Software Foundation.
9+
#
10+
# This library is distributed in the hope that it will be useful, but
11+
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12+
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13+
# License for more details.
14+
#
15+
# You should have received a copy of the GNU Lesser General Public License
16+
# along with this library; if not, write to the Free Software Foundation,
17+
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18+
#
19+
20+
from typing import Protocol
21+
22+
class _Buffer(Protocol):
23+
# Python 3.12+ has collections.abc.Buffer
24+
def __buffer__(self, flags: int) -> memoryview: ...
25+
26+
def argb2rgba(buf: _Buffer) -> None: ...

0 commit comments

Comments
 (0)