Skip to content

0.4.1

Latest
Compare
Choose a tag to compare
@aatle aatle released this 05 Sep 01:43
· 22 commits to main since this release

This release features more API improvements and changes (based on observed pyriak usage), and also improved package documentation.

API Updates

  • tagclass() function removed
  • All add() methods (Entity, StateManager, SystemManager, EntityManager) raise ValueError if the object has already been added
    • New update() method that retains original behavior of add(): remove old object if not equal to new object
  • Added __setitem__ method to Entity and StateManager that has the behavior of update()
  • ComponentRemoved and EventHandlerRemoved events are posted before EntityRemoved and SystemRemoved instead of after
  • Raise a ValueError instead of KeyError in some places
  • bind() decorator will now raise TypeError instead of ValueError when keys are given for an event type with no key function

Typing

  • The component, state, and event handler event types are now generic in their component/state/event type (invariant).
  • The generic callback return type of Binding is now covariant instead of invariant
  • Generic event type of Binding integrated into type of _event_type_ attribute (type -> type[_T])
  • Removed unneeded field annotation in SystemManager

Internal

  • _EventHandler call only accepts (space, event) arguments instead of (*args, **kwargs)
  • _EventHandler is now generic in its event type
  • Event handler events post after they are bound/unbound instead of before
  • Removed redundant, unused type variables in top-level module

Other

  • Rewrote README.md file:
    • More formal and useful, added many sections
    • Provides a guide on basic usage
    • Badges for important info
    • Removed the TODO list
  • Improved PyPI package details: added PyPI classifiers and keywords
  • Added more mypy checks/rules
  • Updated docstrings of various things