overdev / raylib-py

A Python binding for the great C library raylib.
Other
185 stars 20 forks source link

Raylibpy 3.7: Fixed type annotations #32

Closed adamlwgriffiths closed 3 years ago

adamlwgriffiths commented 3 years ago

Using "Array[type]" as an annotation causes errors. So let's use a different annotation. Here I've used "MutableSequence", although there may be a better one and I'm happy to change this to something better.

This combined with #31 get Raylib running on Linux using NixOS.

overdev commented 3 years ago

@adamlwgriffiths The type annotations still need a good revision, like many other things. There are places where Array types seem to work better with ctypes and some other places where any sequence type will do.

Thanks!

adamlwgriffiths commented 3 years ago

Array is probably the correct type, but it doesn't work as an annotation and causes errors at import time. I'm not sure what they appropriate annotation is, there's some conjecture in SO answers so I just used MutableSequence. I don't use the annotations myself I just needed it to import cleanly.