Skip to content

Commit ec0a494

Browse files
committed
Rename Copy to NewReference
1 parent 1bd9c66 commit ec0a494

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/runtime/PythonTypes/PyObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ internal PyObject(in StolenReference reference)
9393
Finalizer.Instance.ThrottledCollect();
9494
}
9595

96-
public PyObject Copy() => new(this);
96+
public PyObject NewReference() => new(this);
9797

9898
// Ensure that encapsulated Python object is decref'ed appropriately
9999
// when the managed wrapper is garbage-collected.

src/runtime/PythonTypes/PyType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ internal PyType(in StolenReference reference, bool prevalidated = false) : base(
3535
throw new ArgumentException("object is not a type");
3636
}
3737

38-
public new PyType Copy() => new(this);
38+
public new PyType NewReference() => new(this);
3939

4040
protected PyType(SerializationInfo info, StreamingContext context) : base(info, context) { }
4141

src/runtime/Types/MethodBinding.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static NewReference mp_subscript(BorrowedReference tp, BorrowedReference
5252
}
5353

5454
MethodObject overloaded = self.m.WithOverloads(overloads);
55-
var mb = new MethodBinding(overloaded, self.target?.Copy(), self.targetType.Copy());
55+
var mb = new MethodBinding(overloaded, self.target?.NewReference(), self.targetType.NewReference());
5656
return mb.Alloc();
5757
}
5858

@@ -139,7 +139,7 @@ public static NewReference tp_getattro(BorrowedReference ob, BorrowedReference k
139139
// FIXME: deprecate __overloads__ soon...
140140
case "__overloads__":
141141
case "Overloads":
142-
var om = new OverloadMapper(self.m, self.target?.Copy(), self.targetType.Copy());
142+
var om = new OverloadMapper(self.m, self.target?.NewReference(), self.targetType.NewReference());
143143
return om.Alloc();
144144
case "__signature__" when Runtime.InspectModule is not null:
145145
var sig = self.Signature;

src/runtime/Types/OverloadMapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static NewReference mp_subscript(BorrowedReference tp, BorrowedReference
4444
return Exceptions.RaiseTypeError(e);
4545
}
4646

47-
var mb = new MethodBinding(self.m, self.target?.Copy(), self.targetType.Copy()) { info = mi };
47+
var mb = new MethodBinding(self.m, self.target?.NewReference(), self.targetType.NewReference()) { info = mi };
4848
return mb.Alloc();
4949
}
5050

0 commit comments

Comments
 (0)