Skip to content

Commit

Permalink
Merge pull request #5 from apiiro/ohad/fix-RemoteInvocationException
Browse files Browse the repository at this point in the history
Fix remote invocation exception
  • Loading branch information
ariel-levy authored Nov 6, 2022
2 parents 583154a + 61a3502 commit 21ca8a7
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ bool isMutable
public override PythonMemberType MemberType => PythonMemberType.Class;
public override IMember GetMember(string name) => name == @"__iter__" ? IteratorType : base.GetMember(name);

public override IMember CreateInstance(IArgumentSet args)
=> new PythonCollection(this, args.Arguments.Select(a => a.Value).OfType<IMember>().ToArray());
public override IMember CreateInstance(IArgumentSet args) {
var contents = args?.Arguments == null
? Array.Empty<IMember>() :
args.Arguments.Select(a => a.Value).OfType<IMember>().ToArray();
return new PythonCollection(this, contents);
}

public override IMember Call(IPythonInstance instance, string memberName, IArgumentSet args)
=> DeclaringModule.Interpreter.GetBuiltinType(TypeId)?.Call(instance, memberName, args);
Expand Down

0 comments on commit 21ca8a7

Please sign in to comment.