Table of Contents

Class ReferenceError

Namespace
NumSharp
Assembly
NumSharp.dll

Python's ReferenceError: a weak-reference proxy was used after its referent was collected (weakly-referenced object no longer exists).

public class ReferenceError : NumSharpException, ISerializable, INumSharpException
Inheritance
ReferenceError
Implements
Inherited Members

Remarks

It derives from NumSharpException: .NET has no exception with the same meaning (a WeakReference<T> reports a collected target by returning false, not by throwing).

NumSharp never raises it; the class exists so a port of code that raises or catches it compiles and behaves as in Python.

Constructors

ReferenceError()

Creates the error with Python's text for a bare raise ReferenceError: an empty Message, as str(ReferenceError()) is ''.

public ReferenceError()

Remarks

ToString() then starts with the class name alone, as Python's traceback prints a bare ReferenceError.

ReferenceError(string)

Creates the error with the interpreter's (or the port's) message.

public ReferenceError(string message)

Parameters

message string

The text, verbatim (weakly-referenced object no longer exists).

ReferenceError(string, Exception)

Creates the error with a message and the exception that caused it: Python's raise ReferenceError(message) from innerException, the cause kept in InnerException.

public ReferenceError(string message, Exception innerException)

Parameters

message string

The text, verbatim.

innerException Exception

The exception that led to this one, or null for none.