Skip to content

Commit 7753e92

Browse files
authored
Improve scene object annotations & docstrings (#1802)
* Fix top-level docstring of Scene object by rewriting it * Rewrite __len__'s docstring to use plain english * Rewrite Scene.__delitem__ docstring for clarity * Rephrase Scene's top-level docstring to be more accurate * Shorten & clarify Scene.from_tilemap docstring * Clarify Scene.get_sprite_list docstring * Rephrase Scene.add_sprite docstring and link relevant methods * Improve Scene.remove_sprite_list_by_* docstrings * Improve Scene's update function docstrings & annotations * Update docstring & typing for Scene.draw * Rephrase top-level Scene module docstring * Rewrite Scene's top-level docstring again for clarity and accuracy * Use KeyError in Scene.move_sprite_list_before * Raise KeyError when before not in Scene + improve move_sprite_list_before docstring * Add a templating exception subclass * Add same modifications to move_sprite_list_after * Fix a doc build issue * Add SceneKeyError to arcade.__all__ * Add example & improve clarity in SceneKeyError's docstring * Additional rephrasing for the top-level docstring * Rephrase __delitem__ docstring * Fix escapes in from_tilemap docstring * Replace redundant escape in get_sprite_list docstring * Fix redundant escapes & typo in __getitem__ docstring * Touch up add_sprite's docstring * Rephrase add_sprite_list_before docstring * Touch up multiple method docstrings * Remove types from docstrings per #1796 + typo fixes * Redo the annotations & docstring for draw_hit_boxes * Rephrase names attribute param documentation * Use SceneKeyError in place of a raw KeyError * Fix typos in add_sprite_list docstring
1 parent a488fdc commit 7753e92

File tree

2 files changed

+239
-124
lines changed

2 files changed

+239
-124
lines changed

arcade/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def configure_logging(level: Optional[int] = None):
181181
from .sprite_list import SpatialHash
182182

183183
from .scene import Scene
184+
from .scene import SceneKeyError
184185

185186
from .physics_engines import PhysicsEnginePlatformer
186187
from .physics_engines import PhysicsEngineSimple
@@ -260,6 +261,7 @@ def configure_logging(level: Optional[int] = None):
260261
'Section',
261262
'SectionManager',
262263
'Scene',
264+
'SceneKeyError',
263265
'Sound',
264266
'BasicSprite',
265267
'Sprite',

0 commit comments

Comments
 (0)