Skip to content

Commit 59b1812

Browse files
committed
Make lambda definitions prettier.
1 parent 2129c50 commit 59b1812

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

sdl3/SDL_surface.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
SDL_SURFACE_PREALLOCATED, SDL_SURFACE_LOCK_NEEDED, SDL_SURFACE_LOCKED, \
1313
SDL_SURFACE_SIMD_ALIGNED = 0x00000001, 0x00000002, 0x00000004, 0x00000008
1414

15-
SDL_MUSTLOCK: abc.Callable[..., bool] = lambda s: (s.flags & SDL_SURFACE_LOCK_NEEDED) == SDL_SURFACE_LOCK_NEEDED
15+
SDL_MUSTLOCK: abc.Callable[..., bool] = lambda s: \
16+
(s.flags & SDL_SURFACE_LOCK_NEEDED) == SDL_SURFACE_LOCK_NEEDED
1617

1718
SDL_ScaleMode: typing.TypeAlias = SDL_TYPE["SDL_ScaleMode", SDL_ENUM]
1819

sdl3/SDL_thread.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ class SDL_Thread(ctypes.c_void_p):
2626
SDL_CreateThreadRuntime: abc.Callable[..., typing.Any] = SDL_FUNC["SDL_CreateThreadRuntime", SDL_POINTER[SDL_Thread], [SDL_ThreadFunction, ctypes.c_char_p, ctypes.c_void_p, SDL_FunctionPointer, SDL_FunctionPointer], SDL_BINARY]
2727
SDL_CreateThreadWithPropertiesRuntime: abc.Callable[..., typing.Any] = SDL_FUNC["SDL_CreateThreadWithPropertiesRuntime", SDL_POINTER[SDL_Thread], [SDL_PropertiesID, SDL_FunctionPointer, SDL_FunctionPointer], SDL_BINARY]
2828

29-
SDL_CreateThread: abc.Callable[[SDL_ThreadFunction, ctypes.c_char_p, ctypes.c_void_p], SDL_POINTER[SDL_Thread]] = lambda fn, name, data: \
30-
SDL_CreateThreadRuntime(fn, name, data, SDL_BeginThreadFunction, SDL_EndThreadFunction)
29+
SDL_CreateThread: abc.Callable[[SDL_ThreadFunction, ctypes.c_char_p, ctypes.c_void_p], SDL_POINTER[SDL_Thread]] = \
30+
lambda fn, name, data: SDL_CreateThreadRuntime(fn, name, data, SDL_BeginThreadFunction, SDL_EndThreadFunction)
3131

32-
SDL_CreateThreadWithProperties: abc.Callable[[SDL_PropertiesID], SDL_POINTER[SDL_Thread]] = lambda props: \
33-
SDL_CreateThreadWithPropertiesRuntime(props, SDL_BeginThreadFunction, SDL_EndThreadFunction)
32+
SDL_CreateThreadWithProperties: abc.Callable[[SDL_PropertiesID], SDL_POINTER[SDL_Thread]] = \
33+
lambda props: SDL_CreateThreadWithPropertiesRuntime(props, SDL_BeginThreadFunction, SDL_EndThreadFunction)
3434

3535
SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER: bytes = "SDL.thread.create.entry_function".encode()
3636
SDL_PROP_THREAD_CREATE_NAME_STRING: bytes = "SDL.thread.create.name".encode()

sdl3/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def SDL_GET_BINARY(name: str) -> ctypes.CDLL | None:
212212
return __module__.binaryMap.get(name, None)
213213

214214
def SDL_NOT_IMPLEMENTED(name: str) -> abc.Callable[..., None]:
215-
return lambda *args, **kwargs: print("\33[31m", f"error: invoked an unimplemented function: '{name}'.", "\33[0m", sep = "", flush = True)
215+
return lambda *args, **kwargs: \
216+
print("\33[31m", f"error: invoked an unimplemented function: '{name}'.", "\33[0m", sep = "", flush = True)
216217

217218
class SDL_FUNC:
218219
@classmethod

0 commit comments

Comments
 (0)