Skip to content

Commit

Permalink
_convert: add type hints
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bgilbert committed Oct 17, 2024
1 parent 0ca2cb6 commit a40175e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions openslide/_convert.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# openslide-python - Python bindings for the OpenSlide library
#
# Copyright (c) 2024 Benjamin Gilbert
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License
# as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

from typing import Protocol

class _Buffer(Protocol):
# Python 3.12+ has collections.abc.Buffer
def __buffer__(self, flags: int) -> memoryview: ...

def argb2rgba(buf: _Buffer) -> None: ...

0 comments on commit a40175e

Please sign in to comment.