-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Doc and typing improvements for pyglet.libs.darwin (#1108)
* Add top-level docstring for libs * Convert quartkey's comments to top-level docstring * Add top-level docstring for coreaudio * Annotate & document libs/cocoapy/runtime.py:ensure_bytes * Document & Annotate get_selector * Doc & annotate get_class * Doc & annotate get_object_class * Doc & annotate get_metaclass * Correct get_object_class docstring phrasing * Correct phrasing of get_class docstring * Doc & annotations for should_use_fpret * Document & annotate x86_should_use_stret * Correct should_use_fpret annotation * Annotate + doc get_superclass_of_object * Touch up docstnig for get_metaclass with sealie software link + phrasing tweaks * Type annotate existing send_message signature * s/selName/selector_name/ * Modernize signature of pyglet.lib.darwin.cocoapy.runtime.send_message * Use keyword arguments with defaults and type variables * Add annotations for the other arguments * Keep kwargs around for backward compatibility * Add comments and spacing to preprocessing block * Update & move commented out debug print statement * Add docstring for send_message & rename TypeVar * Internal comments and spacing for send_message * Explain libs quirks in its top-level docstring * Explain why pyglet.libs should use minimal formatting in docstrings * Mention pyglet.libs not being part of web doc (Ty @caffeinepills) * Add mention of vendored libraries which may be modified * Add None/Nil handling + simplfy existing changes * Add None/Nil return handling to existing annotations * use Type annotation for type-based message probing handlers * Remove non-importable _CData * Use Type + TypeVar or omit annotations instead of _CData * Use future annotation list subscripting instead of List * Clean up imports * Simplify docstrings to favor human and IDE use instead of Sphinx * Clarify argument type configuratoin for messages * Expand into longer definitions * Comment work * Annotate send_message to use arbitary Sequences * Allow send_message to take a Sequence per the ctypes doc * Link the ctypes doc on variadic functions in the send_message docstring * Tweak phrasing of the parameter docstring * Delete send_messsage comment replaced by annotations & docstring * Document and annotate coreaudio.c_literal * Explain function behavior and loose conventions * Rename literal to mnemonic for clarity * Improve error constant commenting and ordering * Add comments explaining where the name comes from & where to see doc * Reorder some constants to put more general ones first * Add a type annotation to err_str_db * Add CoreAudioException + doc & annotations for err_Check * Revert accidental change to a comment * De-Sphinx the top-level coreaudio docstring * De-sphinx docstring for quartzkey.py * Reorder to use human-readable ordering for text format * Use visually clear table style instead of reST list-table:: * Remove all other Sphinx formatting * Reorder constants to match file ordering * Add comments on declaration line marking them as changed from the reference * Consistency fix for runtime.py
- Loading branch information
Showing
4 changed files
with
398 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
"""Platform-specific support components. | ||
These consist of: | ||
1. ctypes bindings for datastructures and functions | ||
2. pyglet-specific wrapper functions around raw ctypes calls | ||
3. vendored libraries in original or modified forms | ||
When documenting these modules: | ||
1. Use minimal formatting in any docstrings | ||
2. Leave licenses at the tops of files in place | ||
Simple docstrings with minimal formatting are best because: | ||
1. No web doc is built for pyglet.lib | ||
2. The docstrings will be used to debug complex platform issues | ||
3. IDEs mangle formatting in any hover tooltips while debugging | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.