diff --git a/dotnet/Razorvine.Pyrolite/Pyrolite/Pickle/Internals/PicklerImplementation.cs b/dotnet/Razorvine.Pyrolite/Pyrolite/Pickle/Internals/PicklerImplementation.cs index 0f8ee0e..cf55294 100644 --- a/dotnet/Razorvine.Pyrolite/Pyrolite/Pickle/Internals/PicklerImplementation.cs +++ b/dotnet/Razorvine.Pyrolite/Pyrolite/Pickle/Internals/PicklerImplementation.cs @@ -240,7 +240,10 @@ private bool dispatch(Type t, object o) put_enumerable(v); return true; case IEnumerable v: - put_enumerable(v); + if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(HashSet<>)) + put_set(v); + else + put_enumerable(v); return true; } }