Table of Contents

Class GeneratorExit

Namespace
NumSharp
Assembly
NumSharp.dll

Python's GeneratorExit: raised inside a generator when it is closed (generator.close()), so its finally blocks run.

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

Remarks

In Python it sits beside Exception under BaseException; NumSharp's derives from NumSharpException, so, footgun, a catch (Exception) catches it. NumSharp never raises it (a C# iterator's finally runs on Dispose()); the class exists for ports.

Constructors

GeneratorExit()

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

public GeneratorExit()

GeneratorExit(string)

Creates the error with the port's message.

public GeneratorExit(string message)

Parameters

message string

The text, verbatim.

GeneratorExit(string, Exception)

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

public GeneratorExit(string message, Exception innerException)

Parameters

message string

The text, verbatim.

innerException Exception

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