You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a lot of flows now you first have to create a temp_bit=Bit(data=data) and then check its id to see if it's in the Library and if not call Library.insert_bit.
Given how common that is, we should probably have a method like Library.insert(data=data) that returns a Bit with that data, inserting it into the library if it doesn't yet exist or returning the Bit with that id if it does. Perhaps it should return a tuple of (bit, was_inserted=False) so you can detect if it was inserted or if it was already there.
The text was updated successfully, but these errors were encountered:
In a lot of flows now you first have to create a
temp_bit=Bit(data=data)
and then check its id to see if it's in the Library and if not callLibrary.insert_bit
.Given how common that is, we should probably have a method like
Library.insert(data=data)
that returns a Bit with that data, inserting it into the library if it doesn't yet exist or returning the Bit with that id if it does. Perhaps it should return a tuple of(bit, was_inserted=False)
so you can detect if it was inserted or if it was already there.The text was updated successfully, but these errors were encountered: