Circular references + detaching objects in Python

sure thing - let me know how it goes! and i’ll update ya when I am able to implement the serialization update in specklepy! and yes, as of the update to BaseObjectSerializerV2 in C#, you will get the expected behaviour you’re looking for if you implement this in .NET :rocket:

__repr__ is a special python “dunder” method that any class can implement to overwrite the string representation of a class (eg what you see what you print the object). any class (speckle or not!) can implement this and it won’t affect any speckle stuff at all.

it’s really useful for cases like this where you want to pull up the important attributes. I implemented them on each of your classes to display the properties we’re talking about in a condensed way so you don’t need to do any manual traversal and printing to debug this.

hehe yes I noticed this issue in your object model which is why I brought it up! it’s a pretty common mistake in python hehe. I fixed this as well in the previously attached files to avoid this issue :sweat_smile:

1 Like