pytransitions / transitions

A lightweight, object-oriented finite state machine implementation in Python with many extensions
MIT License
5.49k stars 524 forks source link

`listify()` now supports empty weak references #531

Closed thedrow closed 3 years ago

thedrow commented 3 years ago

If you attempt to listify an empty weak reference you get a ReferenceError since comparing their type to something is no longer possible. Instead, just return a list containing the object.

thedrow commented 3 years ago

If you're wondering why this is important, this happens when you try to remove a model which is a weakref to an actual object. There are more problems but this solves the most basic one.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.001%) to 98.773% when pulling 4be8bfe7f485beacd74f2e5d443517ccc0ba2169 on thedrow:patch-4 into 350e4dc8ba0dd38c16818dfc800c7a80e23d8572 on pytransitions:master.