sync pyglet update (typing
This commit is contained in:
parent
a46b46ead6
commit
086bd035e7
@ -333,6 +333,7 @@ class _ModuleProxy:
|
|||||||
# Lazily load all modules, except if performing
|
# Lazily load all modules, except if performing
|
||||||
# type checking or code inspection.
|
# type checking or code inspection.
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from . import types
|
||||||
from . import app
|
from . import app
|
||||||
from . import canvas
|
from . import canvas
|
||||||
from . import clock
|
from . import clock
|
||||||
@ -353,6 +354,7 @@ if TYPE_CHECKING:
|
|||||||
from . import text
|
from . import text
|
||||||
from . import window
|
from . import window
|
||||||
else:
|
else:
|
||||||
|
types = _ModuleProxy('types')
|
||||||
app = _ModuleProxy('app')
|
app = _ModuleProxy('app')
|
||||||
canvas = _ModuleProxy('canvas')
|
canvas = _ModuleProxy('canvas')
|
||||||
clock = _ModuleProxy('clock')
|
clock = _ModuleProxy('clock')
|
||||||
|
10
libs/pyglet/types.py
Normal file
10
libs/pyglet/types.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
"""Holds type aliases used throughout the codebase."""
|
||||||
|
import ctypes
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"Buffer"
|
||||||
|
]
|
||||||
|
|
||||||
|
# Backwards compatible placeholder for `collections.abc.Buffer` from Python 3.12
|
||||||
|
Buffer = Union[bytes, bytearray, memoryview, ctypes.Array]
|
Loading…
Reference in New Issue
Block a user