Skip to content

Use stronger typing for buffer protocol objects in gl module#1293

Merged
einarf merged 15 commits intopythonarcade:developmentfrom
pushfoo:temp_fix_for_buffer_protocol_typing
Aug 2, 2022
Merged

Use stronger typing for buffer protocol objects in gl module#1293
einarf merged 15 commits intopythonarcade:developmentfrom
pushfoo:temp_fix_for_buffer_protocol_typing

Conversation

@pushfoo
Copy link
Member

@pushfoo pushfoo commented Aug 2, 2022

Closes #1227 and goes beyond the initial ticket. There were multiple places with weak or absent typing worth improving. There's also a new programming guide section that is linked from the docstrings of the more commonly used objects.

Since GL objects have subtle differences in write behavior, there are two union types:

  1. BufferProtocol as a top-level arcade type to cover general cases
  2. BufferOrBufferProtocol in gl.types for cases where a gl.Buffer is also acceptable.

@einarf einarf merged commit 0a14611 into pythonarcade:development Aug 2, 2022
@pushfoo pushfoo deleted the temp_fix_for_buffer_protocol_typing branch August 2, 2022 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify type buffer protocol type annotations & associated limits

2 participants