~cnx/palace

41969b4030661f7c2603c2d23c7d8b7f055091df — Nguyễn Gia Phong 7 months ago e156f58
Use real Protocol for Python < 3.8

Also fix a minor typing mistake
2 files changed, 3 insertions(+), 7 deletions(-)

M setup.cfg
M src/palace.pyx
M setup.cfg => setup.cfg +1 -0
@@ 29,3 29,4 @@ keywords = openal, alure, hrtf
[options]
zip_safe = False
python_requires = >=3.6
install_requires = typing-extensions; python_version < 3.8

M src/palace.pyx => src/palace.pyx +2 -7
@@ 93,7 93,7 @@ from warnings import catch_warnings, simplefilter, warn
try:    # Python 3.8+
    from typing import Protocol
except ImportError:
    from abc import ABC as Protocol
    from typing_extensions import Protocol

from libc.stdint cimport uint64_t   # noqa
from libc.stdio cimport EOF


@@ 478,7 478,7 @@ cdef class Device:
    cdef alure.Device impl

    def __init__(self, name: str = '', fallback: Iterable[str] = ()) -> None:
        names: Tuple[str] = name, *fallback
        names: Tuple[str, ...] = name, *fallback
        message: Optional[str] = None
        for name in names:
            if message is not None:


@@ 2813,11 2813,6 @@ class FileIO(Protocol):

    Many classes defined in the standard library module `io`
    are compatible with this protocol.

    Note
    ----
    Since PEP 544 is only implemented in Python 3.8+, type checking
    for this on earlier Python version might not work as expected.
    """

    @abstractmethod